Skip to content

Commit b86f909

Browse files
authored
Merge pull request #409 from skyero-aws/master
KCLnode AWS credentials role change and dependabot auto-merge fix
2 parents 75e8060 + 63d426b commit b86f909

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

.github/workflows/node.js.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44

55
name: Sample Run and Dependabot Auto-merge
66
on:
7+
push:
8+
branches: [ master ]
79
pull_request_target:
810
branches: [ master ]
911
workflow_dispatch:
1012

1113
permissions:
1214
id-token: write
1315
contents: write
16+
pull-requests: write
17+
statuses: write
1418

1519
jobs:
1620
sample-run:
@@ -30,13 +34,15 @@ jobs:
3034
steps:
3135
- name: Checkout working directory
3236
uses: actions/checkout@v4
37+
with:
38+
ref: ${{ github.event.pull_request.head.sha }}
3339

3440
- name: Configure AWS Credentials
3541
uses: aws-actions/configure-aws-credentials@v4
3642
with:
3743
aws-region: us-east-1
38-
role-to-assume: arn:aws:iam::751999266872:role/GitHubWorkflows
39-
role-session-name: myGitHubActions
44+
role-to-assume: arn:aws:iam::751999266872:role/GitHubNodejs
45+
role-session-name: myGitHubActionsNodejs
4046

4147
- name: Set up JDK ${{ matrix.jdk-version }}
4248
uses: actions/setup-java@v4
@@ -81,17 +87,25 @@ jobs:
8187
auto-merge-dependabot:
8288
needs: [ sample-run ]
8389
runs-on: ubuntu-latest
84-
if: github.event.pull_request.user.login == 'dependabot[bot]'
90+
if: github.actor == 'dependabot[bot]' && github.event.pull_request.user.login == 'dependabot[bot]'
8591
steps:
8692
- name: Fetch Dependabot metadata
8793
id: metadata
8894
uses: dependabot/fetch-metadata@v2
8995
with:
9096
alert-lookup: true
9197
github-token: "${{ secrets.GITHUB_TOKEN }}"
92-
- name: Enable auto-merge for Dependabot PRs
98+
99+
- name: Approve PR
93100
if: steps.metadata.outputs.update-type != 'version-update:semver-major'
94-
run: gh pr merge --auto --merge "$PR_URL"
101+
run: gh pr review --approve "$PR_URL"
95102
env:
96103
PR_URL: ${{github.event.pull_request.html_url}}
97-
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
104+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
105+
106+
# - name: Enable auto-merge for Dependabot PRs
107+
# if: steps.metadata.outputs.update-type != 'version-update:semver-major'
108+
# run: gh pr merge --auto --merge "$PR_URL"
109+
# env:
110+
# PR_URL: ${{github.event.pull_request.html_url}}
111+
# GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)