Skip to content

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

Merged
merged 2 commits into from
Jun 11, 2025
Merged

Conversation

hiletmis
Copy link
Contributor

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 a CODEOWNER

Due to GitHub PR rules an Auto-Release workflow cannot be utilized on contracts repo unlike data-feeds implementation

@hiletmis hiletmis requested a review from bbenligiray as a code owner June 11, 2025 08:57
@hiletmis hiletmis linked an issue Jun 11, 2025 that may be closed by this pull request
Comment on lines +44 to +51
- 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
Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

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

Comment on lines 12 to 15
contents: write
id-token: write
packages: write
pull-requests: write
Copy link
Member

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

Copy link
Contributor Author

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.

Comment on lines +18 to +24
- 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
Copy link
Member

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?

Copy link
Contributor Author

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

@bbenligiray bbenligiray self-requested a review June 11, 2025 15:59
@bbenligiray bbenligiray merged commit 76b5bfe into main Jun 11, 2025
3 of 4 checks passed
@bbenligiray bbenligiray deleted the add-auto-release-workflow branch June 11, 2025 15:59
@bbenligiray
Copy link
Member

@hiletmis
Copy link
Contributor Author

I will modify it to fail if there is no changeset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a new workflow to automatically release package
2 participants