summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoris Roovers <joris.roovers@gmail.com>2023-06-23 11:49:43 +0200
committerGitHub <noreply@github.com>2023-06-23 11:49:43 +0200
commitde7f8e2e7412be44f731e637d83bc3f51206c93a (patch)
tree05067af08cacb3ce33ed33e5cce596563e384a5d
parent0f5ed5cdde677137abe7a737b87c0face4b3cc4a (diff)
GHA: Comment dev build numbers on PR after merge (#510)
Use GHA to leave a comment with on a PR after its merged with a link to the corresponding dev build on PyPI and instructions on how to install it.
-rw-r--r--.github/workflows/ci.yml26
-rw-r--r--.github/workflows/publish-release.yml4
2 files changed, 30 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b06c01f..d2941a6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -238,3 +238,29 @@ jobs:
secrets: inherit # pass all secrets (required to access secrets in a called workflow)
with:
docs_version: "dev"
+
+ # After merging a PR, leave a comment on the PR with a link to the new dev build
+ notify:
+ needs:
+ - auto-publish-dev
+ if: github.ref == 'refs/heads/main'
+ runs-on: "ubuntu-latest"
+ steps:
+ - uses: actions/github-script@v6
+ with:
+ script: |
+ const body = `Build \
+ [${{ needs.auto-publish-dev.outputs.gitlint_version }}](https://pypi.org/project/gitlint/${{ needs.auto-publish-dev.outputs.gitlint_version }}) \
+ is now available on PyPI!
+
+ Install using:
+ \`\`\`sh
+ pip install gitlint==${{ needs.auto-publish-dev.outputs.gitlint_version }}
+ \`\`\`
+ `;
+ github.rest.issues.createComment({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body: body
+ }); \ No newline at end of file
diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml
index 60961f0..31e4dc9 100644
--- a/.github/workflows/publish-release.yml
+++ b/.github/workflows/publish-release.yml
@@ -18,6 +18,10 @@ on:
required: true
type: string
default: "latest_dev"
+ outputs:
+ gitlint_version:
+ description: "Gitlint version that was published"
+ value: ${{ jobs.publish.outputs.gitlint_version }}
# Manually trigger a release
workflow_dispatch: