-
Notifications
You must be signed in to change notification settings - Fork 15
Create GitHub releases in releaser/tag-pusher workflows #299
Conversation
Revert "include cross-package coverage in codecov"
…ross-package Revert "Revert "include cross-package coverage in codecov""
* move automerge from template to workflows * make automerge reusable and use it from new automerge template * pass parent job name to reusable automerge
* check github actions yamls * make yaml linter happy about go-test * mention VS Code YAML extension in the readme * add info about other YAML checking extensions * make yaml checker more generic
4242e0a to
a230d86
Compare
1186400 to
96c2ec8
Compare
703a7d3 to
4c73325
Compare
4c73325 to
3dfc692
Compare
| # 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. | ||
| if: env.VERSION != '' | ||
| echo "::set-output name=this::$version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use echo "{name}={value}" >> $GITHUB_OUTPUT ?
| if: env.TAG_EXISTS == 'false' | ||
| run: npm install -g "https://github.com/npm/node-semver#e79ac3a450e8bb504e78b8159e3efc7089569" # v7.3.5 | ||
| # https://docs.github.com/en/rest/reference/git#get-a-reference | ||
| gh api '/repos/${{ github.repository }}/git/ref/tags/${{ steps.version.outputs.this }}' && tag_exists='true' || tag_exists='false' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using string interpolation at the yml level here, is it possible a malformed value in steps.version.outputs.this turns into a string injection?
Should we use something like:
env:
TAG_URL: /repos/${{ github.repository }}/git/ref/tags/${{ steps.version.outputs.this }}
run:
gh api "${TAG_URL}" # using shell's expansion here?
| status=$? && ([[ $status == 0 ]] || exit $status) | ||
| fi | ||
| echo "COMMENT<<EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL... cool pattern :)
Do we need to worry about script injection here?
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
|
Moved back to draft for now. I'm going to asses the comments from @laurentsenta and mark it as ready for review afterwards. Thanks 🙇 |
|
Replaced this one with #456 |
Resolved #228
Description
This PR builds up on #295. It is currently targeted at that PR. It can be retargeted to
nextonce that PR is merged.In this PR I refactor
release-checkandreleaserworkflows in such a way that enables adding GitHub Release creation to the process. I propose for a draft GitHub Release to be created duringrelease-checkand for that draft to be published duringrelease.release-checkwill post a link to the draft as a comment. The draft can be modified or deleted manually - those actions will be respected by therelease.I describe what the refactored workflows are doing below.
release-checkversion.jsonthrough GitHub APIgoreleaseandgocompatif a previous version existsreleaseversion.jsonthrough GitHub APIreleaselabel on it - exit if not on a default branch and such a PR does not existTesting
Default branch
Release branch