Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add short sha to env #8

Merged
merged 2 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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