Skip to content

Commit

Permalink
build: set the modified date in separate step
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiStefanie committed Dec 5, 2022
1 parent 476f1ea commit 383ac3e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ jobs:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v32
- name: List all changed files
- name: Prep
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
echo modified_since=$(date -u "+%Y-%m-%dT%H:%MZ" --date='-2 min') >> $GITHUB_ENV
- name: Copy
env:
AZ_ST_CONN_STRING: ${{ secrets.DEV_AZ_ST_CONN_STRING }}
Expand All @@ -59,9 +60,8 @@ jobs:
with:
azcliversion: 2.37.0
inlineScript: |
modified_since=$(date -u "+%Y-%m-%dT%H:%MZ" --date='-2 min')
az storage blob delete-batch -s grc --connection-string $(echo "$AZ_ST_CONN_STRING" | base64 -d) --pattern 'queries/*' --if-unmodified-since $modified_since
az storage blob delete-batch -s grc --connection-string $(echo "$AZ_ST_CONN_STRING" | base64 -d) --pattern 'controls/*' --if-unmodified-since $modified_since
az storage blob delete-batch -s grc --connection-string $(echo "$AZ_ST_CONN_STRING" | base64 -d) --pattern 'queries/*' --if-unmodified-since "${{ env.modified_since }}"
az storage blob delete-batch -s grc --connection-string $(echo "$AZ_ST_CONN_STRING" | base64 -d) --pattern 'controls/*' --if-unmodified-since "${{ env.modified_since }}"
- name: Update
shell: bash
env:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prep
run: |
echo modified_since=$(date -u "+%Y-%m-%dT%H:%MZ" --date='-2 min') >> $GITHUB_ENV
- name: Copy
env:
AZ_ST_CONN_STRING: ${{ secrets.PROD_AZ_ST_CONN_STRING }}
Expand All @@ -31,9 +34,8 @@ jobs:
with:
azcliversion: 2.37.0
inlineScript: |
modified_since=$(date -u "+%Y-%m-%dT%H:%MZ" --date='-2 min')
az storage blob delete-batch -s grc --connection-string $(echo "$AZ_ST_CONN_STRING" | base64 -d) --pattern 'queries/*' --if-unmodified-since $modified_since
az storage blob delete-batch -s grc --connection-string $(echo "$AZ_ST_CONN_STRING" | base64 -d) --pattern 'controls/*' --if-unmodified-since $modified_since
az storage blob delete-batch -s grc --connection-string $(echo "$AZ_ST_CONN_STRING" | base64 -d) --pattern 'queries/*' --if-unmodified-since "${{ env.modified_since }}"
az storage blob delete-batch -s grc --connection-string $(echo "$AZ_ST_CONN_STRING" | base64 -d) --pattern 'controls/*' --if-unmodified-since "${{ env.modified_since }}"
- name: Update
shell: bash
env:
Expand Down

0 comments on commit 383ac3e

Please sign in to comment.