Skip to content

Commit

Permalink
chore: fix update-registry workflow fails to create PR (#829)
Browse files Browse the repository at this point in the history
The action `peter-evans/create-pull-request` used to create the PR was using an outdated version.
Instead switch to the projen provided version which will be automatically updated.
  • Loading branch information
mrgrain authored Jan 22, 2025
1 parent d02c896 commit e7e3b1c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 17 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/update-registry.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 15 additions & 12 deletions projenrc/update-registry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GithubActionsIdentityProvider, GithubActionsRole } from 'aws-cdk-github-oidc';
import { PolicyStatement } from 'aws-cdk-lib/aws-iam';
import { Component, typescript } from 'projen';
import { Component, typescript, github } from 'projen';
import { JobPermission } from 'projen/lib/github/workflows-model';
import { AwsInfrastructure } from './aws-infrastructure';

Expand Down Expand Up @@ -62,18 +62,21 @@ export class UpdateRegistry extends Component {
{ run: this.project.runTaskCommand(task) },

// create a pull request
{
uses: 'peter-evans/create-pull-request@v4',
id: 'create-pr',
with: {
'token': '${{ secrets.PROJEN_GITHUB_TOKEN }}',
'title': 'feat: cloudformation registry update',
'commit-message': 'feat: cloudformation registry update',
'branch': 'automation/update-registry',
'committer': 'GitHub Automation <noreply@github.com>',
'labels': 'auto-approve',
...github.WorkflowActions.createPullRequest({
workflowName: workflow.name,
stepId: 'create-pr',
branchName: 'automation/update-registry',
pullRequestTitle: 'feat: cloudformation registry update',
pullRequestDescription: 'This PR was automatically created by a GitHub Action',
labels: ['auto-approve'],
credentials: github.GithubCredentials.fromPersonalAccessToken({
secret: 'PROJEN_GITHUB_TOKEN',
}),
gitIdentity: {
name: 'GitHub Automation',
email: 'noreply@github.com',
},
},
}),

// Auto-approve PR
{
Expand Down

0 comments on commit e7e3b1c

Please sign in to comment.