1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 16:27:43 +08:00

Merge pull request #30135 from smoogipoo/diffcalc-workflow-state-at-comment

Save `master` state when running diffcalc workflow
This commit is contained in:
Bartłomiej Dach 2024-10-07 12:11:28 +02:00 committed by GitHub
commit 6596d30fb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -104,6 +104,25 @@ env:
EXECUTION_ID: execution-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
jobs:
master-environment:
name: Save master environment
runs-on: ubuntu-latest
outputs:
HEAD: ${{ steps.get-head.outputs.HEAD }}
steps:
- name: Checkout osu
uses: actions/checkout@v4
with:
ref: master
sparse-checkout: |
README.md
- name: Get HEAD ref
id: get-head
run: |
ref=$(git log -1 --format='%H')
echo "HEAD=https://github.com/${{ github.repository }}/commit/${ref}" >> "${GITHUB_OUTPUT}"
check-permissions:
name: Check permissions
runs-on: ubuntu-latest
@ -121,7 +140,7 @@ jobs:
create-comment:
name: Create PR comment
needs: check-permissions
needs: [ master-environment, check-permissions ]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request }}
steps:
@ -158,7 +177,7 @@ jobs:
environment:
name: Setup environment
needs: directory
needs: [ master-environment, directory ]
runs-on: self-hosted
env:
VARS_JSON: ${{ toJSON(vars) }}
@ -182,6 +201,10 @@ jobs:
fi
done
- name: Add master environment
run: |
sed -i "s;^OSU_A=.*$;OSU_A=${{ needs.master-environment.outputs.HEAD }};" "${{ needs.directory.outputs.GENERATOR_ENV }}"
- name: Add pull-request environment
if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request }}
run: |