Context: Supplying a repo Admin's Personal Access Token with the correct permissions should allow them to push commits from within a GitHub Action (as is the case when the third_party_notices are generated). However, I've not been able to get this to work. This was also a problem when running semantic-release. Basically, supplying a personal access token to override the github_token seems broken when branch protection is enabled.
In light of that, this change modifies the workflow to utilize the GitHub API via actions/github-script to disable/enable branch protection. Basically it disables branch protection, performs the commit, then re-enables the same settings that were present before.
Context: Supplying a repo Admin's Personal Access Token with the correct permissions should allow them to push commits from within a GitHub Action (as is the case when the third_party_notices are generated). However, I've not been able to get this to work. This was also a problem when running semantic-release. Basically, supplying a personal access token to override the github_token seems broken when branch protection is enabled.
In light of that, this change modifies the workflow to utilize the GitHub API via actions/github-script to disable/enable branch protection. Basically it disables branch protection, performs the commit, then re-enables the same settings that were present before.