Skip to content

build(deps): bump ytanikin/pr-conventional-commits from 1.4.2 to 1.5.1 #612

build(deps): bump ytanikin/pr-conventional-commits from 1.4.2 to 1.5.1

build(deps): bump ytanikin/pr-conventional-commits from 1.4.2 to 1.5.1 #612

Workflow file for this run

name: Codebuild
on:
push:
branches: [main]
# This event can use aws credentials, but runs against upstream code instead of PR code.
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target
# https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
pull_request_target:
branches: [main]
jobs:
codebuild-trigger:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
env:
source_pr: pr/${{ github.event.pull_request.number }}
source_sha: ${{ github.sha }}
pr_author: ${{ github.event.pull_request.user.login }}
steps:
- uses: actions/checkout@v6
- name: Get permissions
id: get_permission
if: github.event_name == 'pull_request_target'
uses: octokit/request-action@v2.x
with:
route: GET /repos/{repo}/collaborators/{author}/permission
repo: ${{ github.repository }}
author: ${{ github.event.pull_request.user.login }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get credentials
uses: aws-actions/configure-aws-credentials@v5.1.1
with:
role-to-assume: arn:aws:iam::003495580562:role/GitHubOIDCRole
role-session-name: ${{ github.run_id }}
aws-region: us-west-2
- name: Start Codebuild for SHA
# This version runs when PRs are merged to main
if: github.event_name != 'pull_request_target'
run: ./codebuild/bin/start_codebuild.sh $source_sha
- name: Start Codebuild for PR
# This version runs when PRs are created or updated
if: github.event_name == 'pull_request_target'
run: |
permission=$(jq -r '.permission' <<< '${{ steps.get_permission.outputs.data }}')
echo "$pr_author has permission '$permission'".
if [[ "$permission" == "admin" || "$permission" == "write" || "$permission" == "triage" ]]; then
./codebuild/bin/start_codebuild.sh $source_pr
else
echo "$pr_author does not have triage permissions."
echo "A maintainer will need to manually run the Codebuild jobs."
echo ""
echo "Review the latest version of the PR to ensure that the code is safe to execute."
echo "Note the full SHA of the commit that you are reviewing."
echo "Run: ./codebuild/bin/start_codebuild.sh <full sha>"
echo "Warning: use the full SHA, NOT the PR number. The PR could be updated after your review."
fi