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 @@ @@ -1,4 +1,4 @@
name: bump-hls-js
name: bump_hls_js
on:
schedule:
@ -6,7 +6,7 @@ on: @@ -6,7 +6,7 @@ on:
workflow_dispatch:
jobs:
bump-hls-js:
bump_hls_js:
runs-on: ubuntu-20.04
steps:

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

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

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

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

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

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

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

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

45
.github/workflows/release.yml

@ -19,13 +19,11 @@ jobs: @@ -19,13 +19,11 @@ jobs:
name: binaries
path: binaries
github:
github_release:
needs: binaries
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: binaries
@ -58,6 +56,45 @@ jobs: @@ -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:
needs: binaries
runs-on: ubuntu-22.04
@ -87,7 +124,7 @@ jobs: @@ -87,7 +124,7 @@ jobs:
DOCKER_USER_LEGACY: ${{ secrets.DOCKER_USER_LEGACY }}
DOCKER_PASSWORD_LEGACY: ${{ secrets.DOCKER_PASSWORD_LEGACY }}
apidocs:
api_docs:
needs: binaries
runs-on: ubuntu-22.04

Loading…
Cancel
Save