-
Notifications
You must be signed in to change notification settings - Fork 960
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Remove GITHUB_ENV in favor of GITHUB_OUTPUT (#4926)
- Loading branch information
Showing
6 changed files
with
51 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,39 +14,39 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/download-artifact | ||
- name: Parse artifacts and assign GA environment variables | ||
- id: metadata | ||
run: | | ||
pr_number=$(head -n 2 /tmp/artifacts/metadata.txt | tail -n 1) | ||
pr_commit=$(tail -n 1 /tmp/artifacts/metadata.txt) | ||
echo "PR_COMMIT=$pr_commit" >> $GITHUB_ENV | ||
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV | ||
echo "PR_COMMIT=$pr_commit" >> $GITHUB_OUTPUT | ||
echo "PR_NUMBER=$pr_number" >> $GITHUB_OUTPUT | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.PR_COMMIT }} | ||
ref: ${{ steps.metadata.outputs.PR_COMMIT }} | ||
- uses: ./.github/actions/commit-status/start | ||
with: | ||
name: "${{ github.workflow }} / ${{ github.job }} (pull_request_review)" | ||
git_ref: ${{ env.PR_COMMIT }} | ||
git_ref: ${{ steps.metadata.outputs.PR_COMMIT }} | ||
- uses: ./.github/actions/install-deps | ||
- uses: aws-actions/[email protected] | ||
with: | ||
role-to-assume: 'arn:aws:iam::${{ vars.ECR_ACCOUNT_ID }}:role/${{ vars.ECR_SNAPSHOT_ROLE_NAME }}' | ||
aws-region: ${{ vars.ECR_REGION }} | ||
- run: make snapshot | ||
env: | ||
GH_PR_NUMBER: ${{env.PR_NUMBER}} | ||
GH_PR_NUMBER: ${{steps.metadata.outputs.PR_NUMBER}} | ||
- uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: `${{env.PR_NUMBER}}`, | ||
issue_number: `${{steps.metadata.outputs.PR_NUMBER}}`, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: 'Snapshot successfully published to `oci://${{ vars.ECR_ACCOUNT_ID }}.dkr.ecr.${{ vars.ECR_REGION }}.amazonaws.com/karpenter/snapshot/karpenter:v0-${{env.PR_COMMIT}}`.' | ||
body: 'Snapshot successfully published to `oci://${{ vars.ECR_ACCOUNT_ID }}.dkr.ecr.${{ vars.ECR_REGION }}.amazonaws.com/karpenter/snapshot/karpenter:v0-${{steps.metadata.outputs.PR_COMMIT}}`.' | ||
}) | ||
- if: always() | ||
uses: ./.github/actions/commit-status/end | ||
with: | ||
name: "${{ github.workflow }} / ${{ github.job }} (pull_request_review)" | ||
git_ref: ${{ env.PR_COMMIT }} | ||
git_ref: ${{ steps.metadata.outputs.PR_COMMIT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,10 +19,10 @@ jobs: | |
with: | ||
repo_token: '${{ secrets.GITHUB_TOKEN }}' | ||
prerelease: false | ||
- name: Save commit tag to environment | ||
- id: tag | ||
run: | | ||
TAG=$(git describe --tags --exact-match) | ||
echo "TAG=${TAG}" >> $GITHUB_ENV | ||
echo "TAG=${TAG}" >> $GITHUB_OUTPUT | ||
- uses: ./.github/actions/install-deps | ||
- uses: aws-actions/[email protected] | ||
with: | ||
|
@@ -36,19 +36,19 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_REPO: ${{ github.repository }} | ||
- name: Create PR | ||
if: env.TAG != 'no tag' | ||
if: steps.tag.outputs.TAG != 'no tag' | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const { repo, owner } = context.repo; | ||
const result = await github.rest.pulls.create({ | ||
title: 'chore: Release ${{ env.TAG }}', | ||
title: 'chore: Release ${{ steps.tag.outputs.TAG }}', | ||
owner, | ||
repo, | ||
head: 'release-${{ env.TAG }}', | ||
head: 'release-${{ steps.tag.outputs.TAG }}', | ||
base: 'main', | ||
body: [ | ||
'Stable Release Changes for ${{ env.TAG }}.', | ||
'Stable Release Changes for ${{ steps.tag.outputs.TAG }}.', | ||
'Please disregard this PR if it is for a patch release.', | ||
'Please remove the branch after merging.', | ||
'This PR is generated by [StableRelease](https://github.com/aws/karpenter/actions/workflows/stable-release.yml).' | ||
|