Skip to content

Commit

Permalink
Merge pull request #8 from puzzlemeter/chore/add_short_sha
Browse files Browse the repository at this point in the history
chore: add short sha to env
  • Loading branch information
puzzlemeter authored Feb 20, 2023
2 parents d4332ae + 74b7e2c commit bc76cc3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "First action"
name: "Build with Ref Saved"
on:
pull_request:

Expand All @@ -13,13 +13,16 @@ jobs:
CURRENT_BRANCH="${{ github.head_ref }}"
echo "${BASE}" > base.txt
echo "${CURRENT_BRANCH}" > current-branch.txt
echo "${GITHUB_SHA::7}" > github-sha.txt
cat base.txt
cat current-branch.txt
cat github-sha.txt
- name: Upload base ref info
uses: actions/upload-artifact@v3
with:
name: original-refs
path: |
base.txt
current-branch.txt
github-sha.txt
retention-days: 1
5 changes: 3 additions & 2 deletions .github/workflows/deploy-after-build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Deploy after merged"
name: "Deploy After Merged"
on:
workflow_run:
workflows: ["Link action"]
workflows: ["Trigger Deploy Condition"]
types: [completed]

jobs:
Expand All @@ -20,6 +20,7 @@ jobs:
{
echo "BASE=$(cat base.txt)"
echo "CURRENT_BRANCH=$(cat current-branch.txt)"
echo "GITHUB_SHA_SHORT=$(cat github-sha.txt)"
} >> $GITHUB_ENV
echo "${{ toJSON(env) }}"
- name: echo github.event.workflow_run
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/link-action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Link action"
name: "Trigger Deploy Condition"
on:
pull_request:
types:
Expand Down

0 comments on commit bc76cc3

Please sign in to comment.