Skip to content

Commit dde1fda

Browse files
committed
ci(codebuild-pr-build): refactor PR info extraction with env vars
- Extract pull request number and SHA into environment variables - Use env variables instead of inline GitHub context expressions - Improves workflow readability and maintainability - Reduces duplication of GitHub context references in run script
1 parent a2df80e commit dde1fda

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/codebuild-pr-build.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,20 @@ jobs:
8989
path: |
9090
~/.docker-images.tar
9191
key: docker-cache-${{ runner.os }}
92+
93+
- name: Save PR info for PR Linter
94+
if: github.event_name == 'pull_request'
95+
env:
96+
PR_NUMBER: ${{ github.event.pull_request.number }}
97+
PR_SHA: ${{ github.event.pull_request.head.sha }}
98+
run: |
99+
mkdir -p ./pr
100+
echo $PR_NUMBER > ./pr/pr_number
101+
echo $PR_SHA > ./pr/pr_sha
102+
103+
- name: Upload PR info artifact
104+
if: github.event_name == 'pull_request'
105+
uses: actions/upload-artifact@v5
106+
with:
107+
name: pr_info
108+
path: pr/

0 commit comments

Comments
 (0)