Skip to content

Commit

Permalink
PW CI pipeline update5 ready for review so it can be merged and tested (
Browse files Browse the repository at this point in the history
NOAA-EMC#3059)

# Discription

Latest updates to CI GitHub Pipeline:

- Explicitly gets owner of the repo from PRs when coming in from forked
repos (was deficient on last iteration)
- Updated to more current method to GITHUB_OUTPUT for inter job variable
passing

# Type of change
- [x] Bug fix (fixes something broken)
- [ ] New feature (adds functionality)
- [ ] Maintenance (code refactor, clean-up, new CI test, etc.)

NOTE: Many updates where used in the PR process as the pipeline
development had to occur directly in the authoritative repo on the
develop branch for testing `actions/checkout@v4` when cloning from a
forked repo.

# How is this tested
Once the update is made in the default develop branch the action can be
tested.
We can not test this from a forked repo because said test would require
a fork of a fork.

---------

Co-authored-by: Terry McGuinness <[email protected]>
  • Loading branch information
TerrenceMcGuinness-NOAA and Terry McGuinness authored Nov 1, 2024
1 parent 19eca3f commit 5bde649
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/pw_aws_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,14 @@ jobs:
repo_url="https://github.com/${{ github.repository_owner }}/${{ github.repository }}.git"
else
branch=$(gh pr view $pr_number --repo $repo --json headRefName --jq '.headRefName')
repo_url=$(gh pr view $pr_number --repo $repo --json headRepository --jq '.headRepository.url')
repo_owner=$(gh pr view $pr_number --repo $repo --json headRepositoryOwner --jq '.headRepositoryOwner.login')
repo_name=$(gh pr view $pr_number --repo $repo --json headRepository --jq '.headRepository.name')
repo_url="https://github.com/$repo_owner/$repo_name.git"
fi
echo "::set-output name=branch::$branch"
echo "::set-output name=repo::$repo_url"
{
echo "branch=$branch"
echo "repo=$repo_url"
} >> $GITHUB_OUTPUT
checkout:
needs: fetch-branch
Expand Down

0 comments on commit 5bde649

Please sign in to comment.