Skip to content

Commit

Permalink
trigger on push for provenance creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tirumerla committed Dec 9, 2023
1 parent c246b8a commit 2a934e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 45 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/rc-publish-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Publish rc test

on:
workflow_call: {}
push:
branches:
- fix-bugs

# Declare default permissions as read only.
permissions: read-all
Expand All @@ -18,19 +20,9 @@ jobs:
with:
egress-policy: audit

- name: Download SHA artifact
uses: actions/download-artifact@v2
with:
name: sha

- name: Set SHA as env variable
id: set_sha
run: echo "sha=$(cat sha.txt)" >> $GITHUB_OUTPUT

- name: Checkout Repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ steps.set_sha.outputs.sha }}
fetch-depth: 0

- name: Install yq
Expand All @@ -43,11 +35,11 @@ jobs:
- name: Get last commit details
id: commit
run: |
echo "received ${{ steps.set_sha.outputs.sha }}"
COMMIT_SHA=${{ steps.set_sha.outputs.sha }}
COMMIT_SHA="$(git rev-parse HEAD)"
COMMIT_DETAILS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/commits/$COMMIT_SHA")
AUTHOR=$(git show -s --format='%an' ${{ steps.set_sha.outputs.sha }})
AUTHOR=$(git show -s --format='%an' $COMMIT_SHA)
MESSAGE=$(echo $COMMIT_DETAILS | yq '.commit.message')
echo "author=$AUTHOR" >> $GITHUB_OUTPUT
echo "message=$MESSAGE" >> $GITHUB_OUTPUT
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/rc-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,34 +114,3 @@ jobs:
branch: ${{ github.head_ref || github.ref_name }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

# checkout to get the latest commit sha
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Get commit SHA
id: get_sha
run: |
git stash
git pull origin ${{ github.head_ref || github.ref_name }}
SHA=$(git rev-parse HEAD)
echo "sha=$SHA" >> $GITHUB_OUTPUT
echo $SHA > sha.txt
AUTHOR=$(git show -s --format='%an' $(git rev-parse HEAD))
echo "author=$AUTHOR" >> $GITHUB_OUTPUT
- name: Upload SHA as artifact
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: sha
path: sha.txt
retention-days: 1


publish-tag:
name: Publish & Tag
needs: commit-push
uses: ./.github/workflows/rc-publish-test.yml
secrets: inherit

0 comments on commit 2a934e8

Please sign in to comment.