diff options
| author | TrainDoctor <traindoctor@protonmail.com> | 2023-03-05 16:23:17 -0800 |
|---|---|---|
| committer | TrainDoctor <traindoctor@protonmail.com> | 2023-03-05 16:23:17 -0800 |
| commit | 0dd0d9f4bd409852a8a7eab88ecf07b608115d72 (patch) | |
| tree | 2ce7ca441b51b467c4034599aced56ee00f43283 /.github/workflows | |
| parent | 3e5404abdd870d0640f6528ef52e8d75437fe881 (diff) | |
| download | decky-loader-0dd0d9f4bd409852a8a7eab88ecf07b608115d72.tar.gz decky-loader-0dd0d9f4bd409852a8a7eab88ecf07b608115d72.zip | |
Add CI to automatically update plugin stub in templatev2.6.3-pre4v2.6.3
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/edit-check.yml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/.github/workflows/edit-check.yml b/.github/workflows/edit-check.yml new file mode 100644 index 00000000..1cd68b0d --- /dev/null +++ b/.github/workflows/edit-check.yml @@ -0,0 +1,47 @@ +name: Push Updated Plugin Stub to Template + +on: push + +jobs: + copy-stub: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@8230315d06ad95c617244d2f265d237a1682d445 + with: + ref: ${{ github.sha }} + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout + uses: actions/checkout@v2 + + - name: Is stub changed + id: changed-stub + run: | + STUB_CHANGED="false" + PATHS=(plugin plugin/decky_plugin.pyi) + SHA=${{ github.sha }} + SHA_PREV=$(git rev-list --parents -n 1 $SHA) + FILES=$(git diff $SHA_PREV..$SHA --name-only -- ${PATHS[@]} | jq -Rsc 'split("\n")[:-1] | join (",")') + if [[ "$FILES" == *"plugin/decky_plugin.pyi"* ]]; then + $STUB_CHANGED="true" + echo "Stub has changed, pushing updated stub" + else + echo "Stub has not changed, exiting." + echo "has_changed=$STUB_CHANGED" >> $GITHUB_OUTPUT + exit 0 + fi + echo "has_changed=$STUB_CHANGED" >> $GITHUB_OUTPUT + + - name: Push updated stub + if: steps.changed-stub.outputs.has_changed == true + uses: dmnemec/copy_file_to_another_repo_action@bbebd3da22e4a37d04dca5f782edd5201cb97083 + env: + API_TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }} + with: + source_file: 'plugin/decky_plugin.pyi' + destination_repo: 'SteamDeckHomebrew/decky-plugin-template' + user_email: '11465594+TrainDoctor@users.noreply.github.com' + user_name: 'TrainDoctor' + commit_message: 'Updated template with latest plugin stub changes' |
