Skip to content

Commit

Permalink
keep secrets out of 3rd party action
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Apr 22, 2024
1 parent 00a3db5 commit b85cfcf
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/watch-df-steam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: |
mkdir -p $HOME/Steam/config
echo "$STEAM_CONFIG_VDF" | base64 -d >$HOME/Steam/config/config.vdf
- name: Detect changes on branch
- name: Compare branch metadata
uses: nick-fields/retry@v3
env:
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
Expand All @@ -53,18 +53,36 @@ jobs:
+login $STEAM_USERNAME \
+app_info_request 975370 \
+app_info_print 975370 \
+quit | awk '/^{/,0' | awk '/^\t\t"branches"/,0' | awk '/^\t\t\t"beta"/,0' | fgrep timeupdated | head -n1 | cut -d'"' -f4)
+quit | \
awk '/^{/,0' | \
awk '/^\t\t"branches"/,0' | \
awk '/^\t\t\t"beta"/,0' | \
fgrep timeupdated | \
head -n1 | \
cut -d'"' -f4)
echo "timestamp of last branch update: $timestamp"
mkdir -p state
touch state/timestamp
last_timestamp=$(cat state/timestamp)
echo "stored timestamp of last branch update: $last_timestamp"
if [ "$timestamp" != "$last_timestamp" ]; then
echo "launching generate-symbols"
echo "$timestamp" >state/timestamp
gh workflow run generate-symbols.yml -R DFHack/dfhack -r ${{ matrix.dfhack_ref }} -f structures_ref=${{ matrix.structures_ref }} -f version=${{ matrix.version }} -f platform=all -f channel=steam -f df_steam_branch=${{ matrix.df_steam_branch }} -f steam_branch=${{ matrix.steam_branch }}
echo TIMESTAMP_UPDATED=1 >> $GITHUB_ENV
fi
- name: Launch symbol generation workflow
if: env.TIMESTAMP_UPDATED
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh workflow run generate-symbols.yml \
-R DFHack/dfhack \
-r ${{ matrix.dfhack_ref }} \
-f structures_ref=${{ matrix.structures_ref }} \
-f version=${{ matrix.version }} \
-f platform=all \
-f channel=steam \
-f df_steam_branch=${{ matrix.df_steam_branch }} \
-f steam_branch=${{ matrix.steam_branch }}
- name: Save state
uses: actions/cache/save@v4
if: env.TIMESTAMP_UPDATED
Expand Down

0 comments on commit b85cfcf

Please sign in to comment.