Browse Source

automatically inform authors of GitHub issues about new releases (#2685)

pull/2686/head
Alessandro Ros 2 years ago committed by GitHub
parent
commit
4cf8948fe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .github/workflows/bump_hls_js.yml
  2. 8
      .github/workflows/code_lint.yml
  3. 6
      .github/workflows/code_test.yml
  4. 4
      .github/workflows/issue_lint.yml
  5. 4
      .github/workflows/issue_lock.yml
  6. 45
      .github/workflows/release.yml

4
.github/workflows/bump-hls-js.yml → .github/workflows/bump_hls_js.yml

@ -1,4 +1,4 @@
name: bump-hls-js name: bump_hls_js
on: on:
schedule: schedule:
@ -6,7 +6,7 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
bump-hls-js: bump_hls_js:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:

8
.github/workflows/lint.yml → .github/workflows/code_lint.yml

@ -1,4 +1,4 @@
name: lint name: code_lint
on: on:
push: push:
@ -7,7 +7,7 @@ on:
branches: [ main ] branches: [ main ]
jobs: jobs:
code: golangci_lint:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
@ -21,7 +21,7 @@ jobs:
with: with:
version: v1.55.0 version: v1.55.0
mod-tidy: mod_tidy:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
@ -35,7 +35,7 @@ jobs:
go mod tidy go mod tidy
git diff --exit-code git diff --exit-code
apidocs: api_docs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:

6
.github/workflows/test.yml → .github/workflows/code_test.yml

@ -1,4 +1,4 @@
name: test name: code_test
on: on:
push: push:
@ -7,7 +7,7 @@ on:
branches: [ main ] branches: [ main ]
jobs: jobs:
test64: test_64:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
@ -19,7 +19,7 @@ jobs:
with: with:
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}
test32: test_32:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:

4
.github/workflows/issue-lint.yml → .github/workflows/issue_lint.yml

@ -1,11 +1,11 @@
name: issue-lint name: issue_lint
on: on:
issues: issues:
types: [opened] types: [opened]
jobs: jobs:
issue-lint: issue_lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

4
.github/workflows/issue-lock.yml → .github/workflows/issue_lock.yml

@ -1,4 +1,4 @@
name: issue-lock name: issue_lock
on: on:
schedule: schedule:
@ -6,7 +6,7 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
issue-lock: issue_lock:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

45
.github/workflows/release.yml

@ -19,13 +19,11 @@ jobs:
name: binaries name: binaries
path: binaries path: binaries
github: github_release:
needs: binaries needs: binaries
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
name: binaries name: binaries
@ -58,6 +56,45 @@ jobs:
}); });
} }
github_inform_issues:
needs: github_release
runs-on: ubuntu-22.04
steps:
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { repo: { owner, repo } } = context;
const tags = await github.rest.repos.listTags({
owner,
repo,
});
const curTag = tags.data[0];
const prevTag = tags.data[1];
const diff = await github.rest.repos.compareCommitsWithBasehead({
owner,
repo,
basehead: `${prevTag.commit.sha}...${curTag.commit.sha}`,
});
for (const commit of diff.data.commits) {
for (const match of commit.commit.message.matchAll(/(^| |\()#([0-9]+)( |\)|$)/g)) {
try {
await github.rest.issues.createComment({
owner,
repo,
issue_number: parseInt(match[2]),
body: `This issue is mentioned in release ${curTag.name} 🚀\n`
+ `Check out the entire changelog by [clicking here](https://github.com/${owner}/${repo}/releases/tag/${curTag.name})`,
});
} catch (exc) {}
}
}
dockerhub: dockerhub:
needs: binaries needs: binaries
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
@ -87,7 +124,7 @@ jobs:
DOCKER_USER_LEGACY: ${{ secrets.DOCKER_USER_LEGACY }} DOCKER_USER_LEGACY: ${{ secrets.DOCKER_USER_LEGACY }}
DOCKER_PASSWORD_LEGACY: ${{ secrets.DOCKER_PASSWORD_LEGACY }} DOCKER_PASSWORD_LEGACY: ${{ secrets.DOCKER_PASSWORD_LEGACY }}
apidocs: api_docs:
needs: binaries needs: binaries
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04

Loading…
Cancel
Save