Skip to content

Commit

Permalink
Add --target $GITHUB_SHA to ensure latest commit is used for GitHub r…
Browse files Browse the repository at this point in the history
…eleases (#103)

* Add --target $GITHUB_SHA to ensure releases point to the correct commit

* Add code for PR testing

* Add code for PR testing

* Remove existing latest tag before creating a new one

* Specify target commit for timestamp release using GITHUB_SHA

* Revert testing changes

* Use GITHUB_TOKEN variable consistently
  • Loading branch information
ibrahimjaved12 authored Oct 9, 2024
1 parent e9ad73a commit cd0e345
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/weekly_csv_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
run:
|
echo "Creating release: $TAG_NAME"
gh release create "${{ env.TAG_NAME }}" ./private/output/ocw_oer_export.csv -p -t "${{ env.RELEASE_TITLE }}" -n "This release was created for CSV weekly output. Please get the CSV file from the Assets listed below."
gh release create "${{ env.TAG_NAME }}" ./private/output/ocw_oer_export.csv -p -t "${{ env.RELEASE_TITLE }}" -n "This release was created for CSV weekly output. Please get the CSV file from the Assets listed below." --target $GITHUB_SHA
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -87,7 +87,12 @@ jobs:
if gh release view $LATEST_RELEASE_NAME
then
gh release delete $LATEST_RELEASE_NAME
if git rev-parse $LATEST_RELEASE_NAME
then
git tag -d $LATEST_RELEASE_NAME
git push --delete origin $LATEST_RELEASE_NAME
fi
fi
gh release create $LATEST_RELEASE_NAME ./private/output/ocw_oer_export.csv -t "Latest Release" -n "This release was created for CSV weekly output. This release contains the most recent CSV. Please get the CSV file from the Assets listed below." --latest
gh release create $LATEST_RELEASE_NAME ./private/output/ocw_oer_export.csv -t "Latest Release" -n "This release was created for CSV weekly output. This release contains the most recent CSV. Please get the CSV file from the Assets listed below." --latest --target $GITHUB_SHA
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit cd0e345

Please sign in to comment.