Skip to content

Commit

Permalink
Use base branch ref for PR's
Browse files Browse the repository at this point in the history
  • Loading branch information
chippmann committed Oct 12, 2024
1 parent 4738ad7 commit ff56cdf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ runs:
uses: actions/[email protected]
with:
script: |
const ref = process.env.GITHUB_REF.replace(/\//g, '_');
core.exportVariable('PREPARED_REF', ref);
let branch = '';
// Check if it is a PR
if (process.env.GITHUB_HEAD_REF) {
branch = process.env.GITHUB_HEAD_REF.replace(/\//g, '_'); // Use head ref for PRs
} else {
branch = process.env.GITHUB_REF.split('/').slice(2).join('_'); // Standard ref
}
core.exportVariable('PREPARED_REF', branch);
- name: Setup s3 cache
id: cache_setup
Expand Down

0 comments on commit ff56cdf

Please sign in to comment.