Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions .github/workflows/handle-new-mails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,35 @@ concurrency:
jobs:
handle-new-mails:
runs-on: ubuntu-latest
if: vars.CONFIG != ''

steps:
- uses: actions/create-github-app-token@v1
id: gitgitgadget-git-token
id: pr-repo-token
with:
app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }}
owner: gitgitgadget
repositories: git
owner: ${{ fromJSON(vars.CONFIG).repo.owner }}
repositories: ${{ fromJSON(vars.CONFIG).repo.name }}
- uses: actions/create-github-app-token@v1
id: git-git-token
if: ${{ contains(fromJSON(vars.CONFIG).repo.owners, fromJSON(vars.CONFIG).repo.baseOwner) }}
id: upstream-repo-token
with:
app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }}
owner: git
repositories: git
owner: ${{ fromJSON(vars.CONFIG).repo.baseOwner }}
repositories: ${{ fromJSON(vars.CONFIG).repo.name }}
- uses: actions/create-github-app-token@v1
id: dscho-git-token
if: ${{ contains(fromJSON(vars.CONFIG).repo.owners, fromJSON(vars.CONFIG).repo.testOwner) }}
id: test-repo-token
with:
app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }}
owner: dscho
repositories: git
owner: ${{ fromJSON(vars.CONFIG).repo.testOwner }}
repositories: ${{ fromJSON(vars.CONFIG).repo.name }}
- uses: gitgitgadget/gitgitgadget/handle-new-mails@v1
with:
pr-repo-token: ${{ steps.gitgitgadget-git-token.outputs.token }}
upstream-repo-token: ${{ steps.git-git-token.outputs.token }}
test-repo-token: ${{ steps.dscho-git-token.outputs.token }}
config: ${{ vars.CONFIG }}
pr-repo-token: ${{ steps.pr-repo-token.outputs.token }}
upstream-repo-token: ${{ steps.upstream-repo-token.outputs.token }}
test-repo-token: ${{ steps.test-repo-token.outputs.token }}
44 changes: 24 additions & 20 deletions .github/workflows/handle-pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,32 @@ concurrency:
jobs:
handle-pr-comment:
runs-on: ubuntu-latest
if: vars.CONFIG != ''

steps:
- uses: actions/create-github-app-token@v1
id: gitgitgadget-git-token
id: pr-repo-token
with:
app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }}
owner: gitgitgadget
repositories: git
owner: ${{ fromJSON(vars.CONFIG).repo.owner }}
repositories: ${{ fromJSON(vars.CONFIG).repo.name }}
- uses: actions/create-github-app-token@v1
id: git-git-token
if: ${{ contains(fromJSON(vars.CONFIG).repo.owners, fromJSON(vars.CONFIG).repo.baseOwner) }}
id: upstream-repo-token
with:
app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }}
owner: git
repositories: git
owner: ${{ fromJSON(vars.CONFIG).repo.baseOwner }}
repositories: ${{ fromJSON(vars.CONFIG).repo.name }}
- uses: actions/create-github-app-token@v1
id: dscho-git-token
if: ${{ contains(fromJSON(vars.CONFIG).repo.owners, fromJSON(vars.CONFIG).repo.testOwner) }}
id: test-repo-token
with:
app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }}
owner: dscho
repositories: git
owner: ${{ fromJSON(vars.CONFIG).repo.testOwner }}
repositories: ${{ fromJSON(vars.CONFIG).repo.name }}
- name: create a check run
id: create-check-run
run: |
Expand All @@ -66,9 +69,9 @@ jobs:
echo "repo=$repo" >> $GITHUB_OUTPUT

export GH_TOKEN="$(case "$repo" in
gitgitgadget/git) echo "${{ steps.gitgitgadget-git-token.outputs.token }}";;
git/git) echo "${{ steps.git-git-token.outputs.token }}";;
dscho/git) echo "${{ steps.dscho-git-token.outputs.token }}";;
'${{ fromJSON(vars.CONFIG).repo.owner }}/${{ fromJSON(vars.CONFIG).repo.name }}') echo "${{ steps.pr-repo-token.outputs.token }}";;
'${{ fromJSON(vars.CONFIG).repo.baseOwner }}/${{ fromJSON(vars.CONFIG).repo.name }}') echo "${{ steps.upstream-repo-token.outputs.token }}";;
'${{ fromJSON(vars.CONFIG).repo.testOwner }}/${{ fromJSON(vars.CONFIG).repo.name }}') echo "${{ steps.test-repo-token.outputs.token }}";;
*) echo "${{ secrets.GITHUB_TOKEN }}";;
esac
)"
Expand All @@ -84,20 +87,21 @@ jobs:
echo "check_run_id=$check_run_id" >> $GITHUB_OUTPUT
- uses: gitgitgadget/gitgitgadget/handle-pr-comment@v1
with:
pr-repo-token: ${{ steps.gitgitgadget-git-token.outputs.token }}
upstream-repo-token: ${{ steps.git-git-token.outputs.token }}
test-repo-token: ${{ steps.dscho-git-token.outputs.token }}
smtp-host: smtp.gmail.com
smtp-user: [email protected]
config: ${{ vars.CONFIG }}
pr-repo-token: ${{ steps.pr-repo-token.outputs.token }}
upstream-repo-token: ${{ steps.upstream-repo-token.outputs.token }}
test-repo-token: ${{ steps.test-repo-token.outputs.token }}
smtp-host: '${{ fromJSON(vars.CONFIG).mail.smtpHost }}'
smtp-user: '${{ fromJSON(vars.CONFIG).mail.smtpUser }}'
smtp-pass: "${{ secrets.GITGITGADGET_SMTP_PASS }}"
pr-comment-url: ${{ env.PR_COMMENT_URL }}
- name: update the check run
if: always() && steps.create-check-run.outputs.check_run_id != ''
run: |
export GH_TOKEN="$(case "${{ steps.create-check-run.outputs.repo }}" in
gitgitgadget/git) echo "${{ steps.gitgitgadget-git-token.outputs.token }}";;
git/git) echo "${{ steps.git-git-token.outputs.token }}";;
dscho/git) echo "${{ steps.dscho-git-token.outputs.token }}";;
'${{ fromJSON(vars.CONFIG).repo.owner }}/${{ fromJSON(vars.CONFIG).repo.name }}') echo "${{ steps.pr-repo-token.outputs.token }}";;
'${{ fromJSON(vars.CONFIG).repo.baseOwner }}/${{ fromJSON(vars.CONFIG).repo.name }}') echo "${{ steps.upstream-repo-token.outputs.token }}";;
'${{ fromJSON(vars.CONFIG).repo.testOwner }}/${{ fromJSON(vars.CONFIG).repo.name }}') echo "${{ steps.test-repo-token.outputs.token }}";;
*) echo "${{ secrets.GITHUB_TOKEN }}";;
esac
)"
Expand Down
40 changes: 22 additions & 18 deletions .github/workflows/handle-pr-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,32 @@ concurrency:
jobs:
handle-pr-push:
runs-on: ubuntu-latest
if: vars.CONFIG != ''

steps:
- uses: actions/create-github-app-token@v1
id: gitgitgadget-git-token
id: pr-repo-token
with:
app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }}
owner: gitgitgadget
repositories: git
owner: ${{ fromJSON(vars.CONFIG).repo.owner }}
repositories: ${{ fromJSON(vars.CONFIG).repo.name }}
- uses: actions/create-github-app-token@v1
id: git-git-token
if: ${{ contains(fromJSON(vars.CONFIG).repo.owners, fromJSON(vars.CONFIG).repo.baseOwner) }}
id: upstream-repo-token
with:
app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }}
owner: git
repositories: git
owner: ${{ fromJSON(vars.CONFIG).repo.baseOwner }}
repositories: ${{ fromJSON(vars.CONFIG).repo.name }}
- uses: actions/create-github-app-token@v1
id: dscho-git-token
if: ${{ contains(fromJSON(vars.CONFIG).repo.owners, fromJSON(vars.CONFIG).repo.testOwner) }}
id: test-repo-token
with:
app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }}
owner: dscho
repositories: git
owner: ${{ fromJSON(vars.CONFIG).repo.testOwner }}
repositories: ${{ fromJSON(vars.CONFIG).repo.name }}
- name: create a check run
id: create-check-run
run: |
Expand All @@ -64,9 +67,9 @@ jobs:
echo "repo=$repo" >> $GITHUB_OUTPUT

export GH_TOKEN="$(case "$repo" in
gitgitgadget/git) echo "${{ steps.gitgitgadget-git-token.outputs.token }}";;
git/git) echo "${{ steps.git-git-token.outputs.token }}";;
dscho/git) echo "${{ steps.dscho-git-token.outputs.token }}";;
'${{ fromJSON(vars.CONFIG).repo.owner }}/${{ fromJSON(vars.CONFIG).repo.name }}') echo "${{ steps.pr-repo-token.outputs.token }}";;
'${{ fromJSON(vars.CONFIG).repo.baseOwner }}/${{ fromJSON(vars.CONFIG).repo.name }}') echo "${{ steps.upstream-repo-token.outputs.token }}";;
'${{ fromJSON(vars.CONFIG).repo.testOwner }}/${{ fromJSON(vars.CONFIG).repo.name }}') echo "${{ steps.test-repo-token.outputs.token }}";;
*) echo "${{ secrets.GITHUB_TOKEN }}";;
esac
)"
Expand All @@ -82,17 +85,18 @@ jobs:
echo "check_run_id=$check_run_id" >> $GITHUB_OUTPUT
- uses: gitgitgadget/gitgitgadget/handle-pr-push@v1
with:
pr-repo-token: ${{ steps.gitgitgadget-git-token.outputs.token }}
upstream-repo-token: ${{ steps.git-git-token.outputs.token }}
test-repo-token: ${{ steps.dscho-git-token.outputs.token }}
config: ${{ vars.CONFIG }}
pr-repo-token: ${{ steps.pr-repo-token.outputs.token }}
upstream-repo-token: ${{ steps.upstream-repo-token.outputs.token }}
test-repo-token: ${{ steps.test-repo-token.outputs.token }}
pr-url: ${{ env.PR_URL }}
- name: update the check run
if: always() && steps.create-check-run.outputs.check_run_id != ''
run: |
export GH_TOKEN="$(case "${{ steps.create-check-run.outputs.repo }}" in
gitgitgadget/git) echo "${{ steps.gitgitgadget-git-token.outputs.token }}";;
git/git) echo "${{ steps.git-git-token.outputs.token }}";;
dscho/git) echo "${{ steps.dscho-git-token.outputs.token }}";;
'${{ fromJSON(vars.CONFIG).repo.owner }}/${{ fromJSON(vars.CONFIG).repo.name }}') echo "${{ steps.pr-repo-token.outputs.token }}";;
'${{ fromJSON(vars.CONFIG).repo.baseOwner }}/${{ fromJSON(vars.CONFIG).repo.name }}') echo "${{ steps.upstream-repo-token.outputs.token }}";;
'${{ fromJSON(vars.CONFIG).repo.testOwner }}/${{ fromJSON(vars.CONFIG).repo.name }}') echo "${{ steps.test-repo-token.outputs.token }}";;
*) echo "${{ secrets.GITHUB_TOKEN }}";;
esac
)"
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/sync-mailing-list-mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
- cron: "*/5 * * * *"

env:
LORE_EPOCH: 1 # also adjust SOURCE_REPOSITORY
SOURCE_REPOSITORY: https://lore.kernel.org/git/1 # LORE_EPOCH
TARGET_GITHUB_REPOSITORY: gitgitgadget/git-mailing-list-mirror
MIRROR_REF: ${{ fromJSON(vars.CONFIG).mailrepo.mirrorRef }}
SOURCE_REPOSITORY: ${{ fromJSON(vars.CONFIG).mailrepo.url }}${{ fromJSON(vars.CONFIG).mailrepo.public_inbox_epoch }}
TARGET_GITHUB_REPOSITORY: ${{ fromJSON(vars.CONFIG).mailrepo.owner }}/${{ fromJSON(vars.CONFIG).mailrepo.name }}

concurrency:
group: sync-mailing-list-mirror
Expand All @@ -27,16 +27,16 @@ jobs:
echo "org=${TARGET_GITHUB_REPOSITORY%%/*}" >>$GITHUB_OUTPUT &&
echo "repo=${TARGET_GITHUB_REPOSITORY#*/}" >>$GITHUB_OUTPUT &&
source="$(git ls-remote "$SOURCE_REPOSITORY" master)" &&
target="$(git ls-remote https://github.com/"$TARGET_GITHUB_REPOSITORY" lore-$LORE_EPOCH)" &&
target="$(git ls-remote https://github.com/"$TARGET_GITHUB_REPOSITORY" "$MIRROR_REF")" &&
echo "result=$(test "${source%% *}" = "${target%% *}" && echo false || echo true)" >>$GITHUB_OUTPUT
- name: Partial clone
if: steps.needs-update.outputs.result == 'true'
run: |
git clone --bare --depth=1 -b lore-$LORE_EPOCH --filter=blob:none https://github.com/$TARGET_GITHUB_REPOSITORY .
git clone --bare --depth=1 -b "${MIRROR_REF#refs/heads/}" --filter=blob:none https://github.com/$TARGET_GITHUB_REPOSITORY .
- name: Update from lore.kernel.org
if: steps.needs-update.outputs.result == 'true'
run: |
git fetch "$SOURCE_REPOSITORY" refs/heads/master:refs/heads/lore-$LORE_EPOCH
git fetch "$SOURCE_REPOSITORY" refs/heads/master:"$MIRROR_REF"
- name: obtain installation token
if: steps.needs-update.outputs.result == 'true'
uses: actions/create-github-app-token@v2
Expand All @@ -51,4 +51,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
run: |
git push https://$GITHUB_ACTOR:[email protected]/$TARGET_GITHUB_REPOSITORY lore-$LORE_EPOCH
git push https://$GITHUB_ACTOR:[email protected]/$TARGET_GITHUB_REPOSITORY "$MIRROR_REF"
8 changes: 1 addition & 7 deletions .github/workflows/sync-upstream-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
spec:
- sourceRepo: j6t/git-gui
targetRepo: gitgitgadget/git
targetRefNamespace: git-gui/
- sourceRepo: gitster/git
targetRepo: gitgitgadget/git
sourceRefRegex: "^refs/heads/(maint-\\d|[a-z][a-z]/)"
spec: ${{ fromJSON(vars.CONFIG).syncUpstreamBranches }}

steps:
- name: check which refs need to be synchronized
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/update-mail-to-commit-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ concurrency:
jobs:
update-mail-to-commit-notes:
runs-on: ubuntu-latest
if: vars.CONFIG != ''

steps:
- uses: actions/create-github-app-token@v1
id: gitgitgadget-git-token
id: pr-repo-token
with:
app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }}
owner: gitgitgadget
repositories: git
owner: ${{ fromJSON(vars.CONFIG).repo.owner }}
repositories: ${{ fromJSON(vars.CONFIG).repo.name }}
- uses: gitgitgadget/gitgitgadget/update-mail-to-commit-notes@v1
with:
pr-repo-token: ${{ steps.gitgitgadget-git-token.outputs.token }}
config: ${{ vars.CONFIG }}
pr-repo-token: ${{ steps.pr-repo-token.outputs.token }}
28 changes: 16 additions & 12 deletions .github/workflows/update-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,35 @@ concurrency:
jobs:
update-prs:
runs-on: ubuntu-latest
if: vars.CONFIG != ''

steps:
- uses: actions/create-github-app-token@v1
id: gitgitgadget-git-token
id: pr-repo-token
with:
app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }}
owner: gitgitgadget
repositories: git
owner: ${{ fromJSON(vars.CONFIG).repo.owner }}
repositories: ${{ fromJSON(vars.CONFIG).repo.name }}
- uses: actions/create-github-app-token@v1
id: git-git-token
if: ${{ contains(fromJSON(vars.CONFIG).repo.owners, fromJSON(vars.CONFIG).repo.baseOwner) }}
id: upstream-repo-token
with:
app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }}
owner: git
repositories: git
owner: ${{ fromJSON(vars.CONFIG).repo.baseOwner }}
repositories: ${{ fromJSON(vars.CONFIG).repo.name }}
- uses: actions/create-github-app-token@v1
id: dscho-git-token
if: ${{ contains(fromJSON(vars.CONFIG).repo.owners, fromJSON(vars.CONFIG).repo.testOwner) }}
id: test-repo-token
with:
app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }}
private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }}
owner: dscho
repositories: git
owner: ${{ fromJSON(vars.CONFIG).repo.testOwner }}
repositories: ${{ fromJSON(vars.CONFIG).repo.name }}
- uses: gitgitgadget/gitgitgadget/update-prs@v1
with:
pr-repo-token: ${{ steps.gitgitgadget-git-token.outputs.token }}
upstream-repo-token: ${{ steps.git-git-token.outputs.token }}
test-repo-token: ${{ steps.dscho-git-token.outputs.token }}
config: ${{ vars.CONFIG }}
pr-repo-token: ${{ steps.pr-repo-token.outputs.token }}
upstream-repo-token: ${{ steps.upstream-repo-token.outputs.token }}
test-repo-token: ${{ steps.test-repo-token.outputs.token }}