Skip to content

🎉 traP Collectionのデプロイ権限にmasky5859を追加 #987

🎉 traP Collectionのデプロイ権限にmasky5859を追加

🎉 traP Collectionのデプロイ権限にmasky5859を追加 #987

Workflow file for this run

name: Diff
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
diff:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
# Simpler alternative: https://stackoverflow.com/a/73596568
# - name: Setup to skip ksops decryption
# run: sudo ln -s /bin/true /usr/local/bin/ksops
- name: Prepare ksops-dry-run
run: |
curl -LOf https://github.com/motoki317/ksops-dry-run/releases/download/v0.3.1/ksops-dry-run-linux-amd64.tar.gz
tar -zxvf ksops-dry-run-linux-amd64.tar.gz ksops-dry-run
sudo install ksops-dry-run /usr/local/bin/ksops
rm ksops-dry-run-linux-amd64.tar.gz
- name: Fetch base
uses: actions/checkout@v5
with:
fetch-depth: "2"
- name: Install dyff
run: |
set -o pipefail
curl -fsL https://git.io/JYfAY | bash
- name: Diff
id: diff
run: |
TARGET=HEAD^ \
DYFF_OPTIONS="--omit-header --output github" \
.scripts/diff-to-old.sh ./*/ \
| tee diff.txt
DIFF=$(cat diff.txt)
DIFF_LENGTH=${#DIFF}
echo 'diff<<EOF' >> $GITHUB_OUTPUT
cat diff.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
echo "diff_length=$DIFF_LENGTH" >> $GITHUB_OUTPUT
echo '### Diff' >> $GITHUB_STEP_SUMMARY
echo '```diff' >> $GITHUB_STEP_SUMMARY
cat diff.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- if: ${{ steps.diff.outputs.diff != '' && steps.diff.outputs.diff_length > 50000 }}
name: Add comment
uses: mshick/add-pr-comment@v2
with:
message-id: "${{ github.event.pull_request.number }}"
message-failure: Diff was not successful
message: |
### Diff
Diff was too long (> 50k chars) to include in PR comment.
Please check actions summary for more info.
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- if: ${{ steps.diff.outputs.diff != '' && steps.diff.outputs.diff_length <= 50000 }}
name: Add comment
uses: mshick/add-pr-comment@v2
with:
message-id: "${{ github.event.pull_request.number }}"
message-failure: Diff was not successful
message: |
### Diff
```diff
${{ steps.diff.outputs.diff }}
```
- if: ${{ steps.diff.outputs.diff == '' }}
name: Add comment
uses: mshick/add-pr-comment@v2
with:
message-id: "${{ github.event.pull_request.number }}"
message-failure: Diff was not successful
message: |
### Diff
No diff detected!