From b85cfcfebc0ebd27b658f0440a53221b2d6ad247 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Mon, 22 Apr 2024 01:28:07 -0700 Subject: [PATCH] keep secrets out of 3rd party action --- .github/workflows/watch-df-steam.yml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/watch-df-steam.yml b/.github/workflows/watch-df-steam.yml index 01d6ec04bc..12d428f1e7 100644 --- a/.github/workflows/watch-df-steam.yml +++ b/.github/workflows/watch-df-steam.yml @@ -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 }} @@ -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