-
Notifications
You must be signed in to change notification settings - Fork 5
Add workflow to initiate package release #525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- name: Check changeset files | ||
id: check_files | ||
run: | | ||
if find ./.changeset -maxdepth 1 -type f -name "*.md" ! -name "README.md" | grep -q .; then | ||
echo "files_exists=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "files_exists=false" >> $GITHUB_OUTPUT | ||
fi |
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.
There's already another workflow for this
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.
This check is basically to avoid PR creation if there is no changeset files present at the moment
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.
I suppose they're not exactly the same
contents: write | ||
id-token: write | ||
packages: write | ||
pull-requests: write |
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.
Not sure if all are needed
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.
id-token: write
packages: write
can be removed.
- name: Check if main branch is used | ||
run: | | ||
BRANCH_NAME=$(echo $GITHUB_REF | awk -F'/' '{print $3}') | ||
if [[ "$BRANCH_NAME" != "main" ]]; then | ||
echo "Branch $BRANCH_NAME is not allowed to use this action" | ||
exit 1 | ||
fi |
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 already specifying the head branch as main
in the command below, why is this needed?
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.
Workflow can be run on any branch. Running on any other branch won't affect the flow but it is misleading to leave it as is
@hiletmis I guess it would be better if https://github.com/api3dao/contracts/actions/runs/15589799522/job/43905629996 failed |
I will modify it to fail if there is no changeset |
Closes #524
This PR introduces a new workflow that creates a release initiation PR (aka
Initiate release
)Workflow checks if it is running on
main
branch and triggered by aCODEOWNER
Due to GitHub PR rules an
Auto-Release
workflow cannot be utilized on contracts repo unlike data-feeds implementation