diff #279
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: diff | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'v[0-9]+.[0-9]+' | |
tags: | |
- 'v*' | |
schedule: | |
- cron: '0 11 * * *' # everyday at 11am | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
SRC_REMOTE: upstream | |
DST_REMOTE: origin | |
SRC_REPO: https://github.com/moby/buildkit | |
jobs: | |
update-diffs: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
ref: | |
- 'v0.11' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: 'main' | |
- name: Prepare | |
run: | | |
git remote add ${{ env.SRC_REMOTE }} ${{ env.SRC_REPO }} | |
git fetch --depth=1 ${{ env.SRC_REMOTE }} ${{ matrix.ref }} | |
git remote add ${{ env.DST_REMOTE }} ${{ github.repositoryUrl }} || true | |
git fetch --depth=1 ${{ env.DST_REMOTE }} ${{ matrix.ref }} | |
- name: Diff | |
run: | | |
cat > diff.${{ matrix.ref }}.md <<EOF | |
\`\`\`diff | |
$(git diff ${{ env.SRC_REMOTE }}/${{ matrix.ref }} \ | |
${{ env.DST_REMOTE }}/${{ matrix.ref }} \ | |
--src-prefix=${{ env.SRC_REMOTE }}/${{ matrix.ref }}/ \ | |
--dst-prefix=${{ env.DST_REMOTE }}/${{ matrix.ref }}/) | |
\`\`\` | |
EOF | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: 'Automatic update for diff.${{ matrix.ref }}.md' | |
add: 'diff.${{ matrix.ref }}.md' | |
push: origin main | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: diff.${{ matrix.ref }}.md | |
path: diff.${{ matrix.ref }}.md |