-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat(publish): Add allowlist for branches to take craft config from #3452
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,11 +36,28 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: node .__publish__/src/publish/post-workflow-details.js | ||
|
||
# Setting the target repo branch will cause the craft config (.craft.yml) to be taken from the checked out branch | ||
# By default, we check out the default branch of the repo. | ||
# If you need to maintain diverging craft configs on different branches, add your repo and the merge target branch | ||
# (i.e. the branch craft will merge the release branch into) into the if condition below. | ||
- name: Set target repo checkout branch | ||
# Note: Branches registered here MUST BE protected in the target repo! | ||
if: | | ||
fromJSON(steps.inputs.outputs.result).repo == 'sentry-javascript' && fromJSON(steps.inputs.outputs.result).merge_target == 'develop' || | ||
fromJSON(steps.inputs.outputs.result).repo == 'sentry-javascript' && fromJSON(steps.inputs.outputs.result).merge_target == 'v7' || | ||
fromJSON(steps.inputs.outputs.result).repo == 'sentry-migr8' && fromJSON(steps.inputs.outputs.result).merge_target == 'main' || | ||
fromJSON(steps.inputs.outputs.result).repo == 'sentry-migr8' && fromJSON(steps.inputs.outputs.result).merge_target == 'tmp-merge-target' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I opted to temporarily add an entry for sentry-migr8 here so that I can test this before we add e.g. the JS SDK repo. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For sentry-migr8 it should be fine to cut a few releases as it's still just a hackweek project at the moment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's add branch protection to that repo just so we're following the process There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
id: target-repo-branch | ||
run: | | ||
target_repo_branch="{{ fromJSON(steps.inputs.outputs.result).merge_target }}" | ||
echo 'taking craft config from branch {{ fromJSON(steps.inputs.outputs.result).merge_target }} in {{ fromJSON(steps.inputs.outputs.result).repo }}' | ||
|
||
- uses: actions/checkout@v3 | ||
name: Check out target repo | ||
if: ${{ steps.inputs.outputs.result }} | ||
with: | ||
path: __repo__ | ||
ref: ${{ steps.target-repo-branch.outputs.target_repo_branch || ''}} | ||
repository: getsentry/${{ fromJSON(steps.inputs.outputs.result).repo }} | ||
token: ${{ secrets.GH_SENTRY_BOT_PAT }} | ||
fetch-depth: 0 | ||
|
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 think this first one wouldn't be needed since this is the default branch?
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.
removed