Skip to content

Commit

Permalink
chore: modify to what i expected
Browse files Browse the repository at this point in the history
  • Loading branch information
puzzlemeter committed Feb 20, 2023
1 parent a701072 commit 542f0cc
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 97 deletions.
38 changes: 20 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- run: |
echo "Build with Ref Saved"
# - name: Save base ref info
# run: |
# BASE="${{ github.base_ref }}"
# CURRENT_BRANCH="${{ github.head_ref }}"
# echo $BASE > base.txt
# echo $CURRENT_BRANCH > current-branch.txt
# cat base.txt
# cat current-branch.txt
# - name: Upload base ref info
# uses: actions/upload-artifact@v3
# with:
# name: original-refs
# path: |
# base.txt
# current-branch.txt
# retention-days: 1
- uses: actions/checkout@v3
- name: Save base ref info
run: |
BASE="${{ github.base_ref }}"
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
34 changes: 17 additions & 17 deletions .github/workflows/deploy-after-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- run: |
echo "Deploy After Merged"
# - name: Download a single artifact
# uses: dawidd6/action-download-artifact@v2
# with:
# workflow: build.yml
# name: original-refs
# workflow_conclusion: success
# - name: set REF_BASE to env
# run: |
# {
# echo "BASE=$(cat base.txt)"
# echo "CURRENT_BRANCH=$(cat current-branch.txt)"
# } >> $GITHUB_ENV
# echo "${{ toJSON(env) }}"
# - name: echo github.event.workflow_run
# run: echo "${{ toJSON(github.event.workflow_run) }}"
- name: Download a single artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
name: original-refs
workflow_conclusion: success
- name: set REF_BASE to env
run: |
{
echo "BASE=$(cat base.txt)"
echo "CURRENT_BRANCH=$(cat current-branch.txt)"
echo "GITHUB_SHA_SHORTEN=$(cat github-sha.txt)"
} >> $GITHUB_ENV
- name: echo env
run: echo "${{ toJSON(env) }}"
- name: echo github.event.workflow_run
run: echo "${{ toJSON(github.event.workflow_run) }}"
# dump:
# runs-on: ubuntu-latest
# steps:
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/first-action.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/second-action.yml

This file was deleted.

0 comments on commit 542f0cc

Please sign in to comment.