-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[No QA] Migrate updateProtectedBranch from workflow to composite action #9654
Conversation
|
@@ -0,0 +1,140 @@ | |||
name: Update Protected 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.
Reviewer note: this action is largely the same as the deleted .github/workflows/updateProtectedBranch.yml
, so comparing it to that might make it easier to review.
|
||
jobs: | ||
updateBranch: | ||
if: github.actor == 'OSBotify' |
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.
Reviewer note: This check is not needed anymore. Because it's now an action and not a manually-triggerable workflow, there's no way a non-bot could trigger this action manually, which is why we had this check in the first place.
fi | ||
|
||
# Version: 2.3.4 | ||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f |
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.
Reviewer note: This checkout is no longer needed because, unlike the workflow, the action runs on the same machine that triggers it. Since the action is loaded from a local URL, we know for sure that if we're in the action we will have already ran a checkout and will have the repo cloned on the runner.
echo "SOURCE_BRANCH=${{ github.event.inputs.SOURCE_BRANCH }}" >> "$GITHUB_ENV" | ||
fi | ||
|
||
- uses: Expensify/App/.github/actions/composite/setupGitForOSBotify@main |
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.
Note: I did an experiment and confirmed that you can use nested composite actions
# Version: 3.3.0 | ||
uses: umani/changed-files@1d252c611c64289d35243fc37ece7323ea5e93e1 | ||
with: | ||
repo-token: ${{ github.token }} |
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.
Note: I did an experiment and confirmed that, even though secrets are not directly available in an action, the full github context, including github.token
is available.
Off hold and ready for review 🙂 |
Requesting another reviewer since @Luke9389 is OOO |
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.
LGTM
Okay, let's test this out 🤞 |
Monitoring here |
🚀 Deployed to staging by @roryabraham in version: 1.1.81-0 🚀
|
🚀 Deployed to production by @roryabraham in version: 1.1.82-5 🚀
|
Details
This is part of a minor cleanup initiative I've been working on to deprecate some hacky workarounds we had in our GitHub Actions code to GitHub-native functionality, which improves the speed, clarity, and transparency of our CI/CD. It should also help reduce barriers to entry to our GitHub Actions code because it will be following the practices in the GitHub Actions documentation.
In this instance, not having to wait for workflows to spin up or conclude will speed things up pretty substantially.
Fixed Issues
$ (partial) prepping for https://github.com/Expensify/Expensify/issues/195693
Tests
CP Staging
label