Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b10cc2d
Revert "include cross-package coverage in codecov"
galargh Dec 10, 2021
8d7b557
Merge pull request #245 from protocol/revert-210-codecov-cross-package
galargh Dec 10, 2021
af39fc8
Revert "Revert "include cross-package coverage in codecov""
galargh Dec 10, 2021
3d5f0d1
Merge pull request #246 from protocol/revert-245-revert-210-codecov-c…
galargh Dec 10, 2021
6f5cf40
Make automerge a reusable workflow (#260)
galargh Jan 7, 2022
3543681
Merge remote-tracking branch 'origin/master' into next
galargh Jan 11, 2022
0454bfc
check github actions yamls (#272)
galargh Jan 11, 2022
c9b7c51
use validate-yaml-schema action from mainline (#277)
galargh Jan 12, 2022
816b8a7
upgrade lewagon/wait-on-check-action to v1.1.1 (#278)
galargh Jan 13, 2022
1a2b29c
always add a version.json file if it doesn't exist (#281)
galargh Jan 14, 2022
97688fd
fix go-test runner string
galargh Jan 14, 2022
9d885d4
check if tag already exists in release-check (#287)
galargh Jan 28, 2022
a199227
allow specifying custom PATH for 386 arch (#289)
galargh Feb 1, 2022
1814d3c
use pull_request_target event for release-check workflow
galargh Feb 22, 2022
5f45689
add comment on missing version.json
galargh Mar 16, 2022
b08430a
Merge branch 'next' into pr-target-release-check
galargh Nov 14, 2022
1b67020
Merge branch 'next' into pr-target-release-check
galargh Jan 5, 2023
a4bdee8
Merge remote-tracking branch 'origin/next' into pr-target-release-check
galargh Jan 16, 2023
c1afd5f
chore: revert release checker path trigger change
galargh Jan 16, 2023
618d652
chore: add footnote when non-docs files are modified with the release
galargh Jan 16, 2023
87bda4f
Merge remote-tracking branch 'origin/next' into pr-target-release-check
galargh Feb 1, 2023
3a1f5dd
fix: prev version calculation
galargh Feb 1, 2023
7db61bc
fix: diff calculation in release-check
galargh Feb 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 28 additions & 37 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# This workflow cannot post sticky comments on PRs from forked repositories.
# Instead, it outputs the message it would have posted as a workflow notice.
# See https://github.com/protocol/.github/issues/254 for details.

name: Release Checker
on: [ workflow_call ]

Expand All @@ -22,8 +18,14 @@ jobs:
with:
go-version: "1.19.x"
- name: Determine version
if: hashFiles('version.json')
run: echo "VERSION=$(jq -r .version version.json)" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
# If `version.json` file doesn't exists, `version` is `""` and `404` is printed on stderr.
# The step won't be marked as a failure though because the error happens in a subshell.
version="$(gh api -X GET 'repos/${{ github.event.pull_request.head.repo.full_name }}/contents/version.json' -f ref='${{ github.event.pull_request.head.sha }}' --jq '.content' | base64 -d | jq -r '.version')"
Comment thread
galargh marked this conversation as resolved.
Outdated
echo "version=$version"
echo "VERSION=$version" >> $GITHUB_ENV
- name: Check if the tag already exists
# Check if a git tag for the version (as read from version.json) exists
# If that is the case, we don't need to run the rest of the workflow.
Expand Down Expand Up @@ -109,39 +111,28 @@ jobs:
If you wish to cut a release once this PR is merged, please add the \`release\` label to this PR.
EOF" >> $GITHUB_ENV
if: github.base_ref != github.event.repository.default_branch
- run: |
echo 'MESSAGE<<EOF
Suggested version: `${{ env.VERSION }}`
Comparing to: [`${{ env.COMPARETO }}`](${{ github.event.pull_request.base.repo.html_url }}/releases/tag/${{ env.COMPARETO }}) ([diff](${{ github.event.pull_request.base.repo.html_url }}/compare/${{ env.COMPARETO }}..${{ github.event.pull_request.head.label }}))

Changes in `go.mod` file(s):
```diff
${{ env.GOMODDIFF }}
```

`gorelease` says:
```
${{ env.GORELEASE }}
```

`gocompat` says:
```
${{ env.GOCOMPAT }}
```
${{ env.RELEASE_BRANCH_NOTE }}
EOF' >> $GITHUB_ENV
if: env.TAG_EXISTS == 'false' && env.COMPARETO != ''
- name: Post message on PR
uses: marocchino/sticky-pull-request-comment@82e7a0d3c51217201b3fedc4ddde6632e969a477 # v2.1.1
if: env.TAG_EXISTS == 'false' && env.COMPARETO != '' && github.event.pull_request.head.repo.full_name == github.repository
if: env.TAG_EXISTS == 'false' && env.COMPARETO != ''
with:
header: release-check
recreate: true
message: ${{ env.MESSAGE }}
- name: Set a notice message on run
run: |
message="${MESSAGE//'%'/'%25'}"
message="${message//$'\n'/'%0A'}"
message="${message//$'\r'/'%0D'}"
echo "::notice ::$message"
if: env.TAG_EXISTS == 'false' && env.COMPARETO != '' && github.event.pull_request.head.repo.full_name != github.repository
message: |
Suggested version: `${{ env.VERSION }}`
Comparing to: [`${{ env.COMPARETO }}`](${{ github.event.pull_request.base.repo.html_url }}/releases/tag/${{ env.COMPARETO }}) ([diff](${{ github.event.pull_request.base.repo.html_url }}/compare/${{ env.COMPARETO }}..${{ github.event.pull_request.head.label }}))

Changes in `go.mod` file(s):
```diff
${{ env.GOMODDIFF }}
```

`gorelease` says:
```
${{ env.GORELEASE }}
```

`gocompat` says:
```
${{ env.GOCOMPAT }}
```
${{ env.RELEASE_BRANCH_NOTE }}
4 changes: 2 additions & 2 deletions templates/.github/workflows/release-check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Release Checker
on:
pull_request:
paths: [ 'version.json' ]
pull_request_target:
paths-ignore: [ '!version.json' ]
Comment thread
galargh marked this conversation as resolved.
Outdated

jobs:
release-check:
Expand Down