Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Updating CI/CD to check for protected branch and use token so workflow re-runs (release/21.0.x branch) #756

Merged
merged 7 commits into from
Jun 12, 2020

Conversation

bradlhart
Copy link
Contributor

Change Description

When merging with protected branches, the yarn.lock updates will fail to push. This will check if the branch is protected and avoid pushing and failing.

Additionally, the workflow needs to re-run and succeed in order to easily merge. However, the github.token supplied to GitHub Actions will not re-run a workflow if it fires the event to avoid infinite runs of the workflow. Adding and using a different token will allow the workflow to re-run. Infinite runs is not an issue for this workflow since it only runs again if there are any updates to the dependencies.

Since forks wouldn't have the token set in their repo secrets but all repos have github.token set inside workflows, it was also important to create a conditional that allows the workflow to checkout with either token so workflows ran in forks won't fail without the token in the repo secrets.

Second PR to cherry pick commits to release/21.0.x branch

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

@bradlhart bradlhart merged commit 59367b8 into release/21.0.x Jun 12, 2020
@bradlhart bradlhart deleted the protected-cicd-release21 branch June 12, 2020 21:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants