Skip to content
Merged
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
56 changes: 10 additions & 46 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,17 @@ name: Backport PR to branch
on:
issue_comment:
types: [created]
schedule:
# once a day at 13:00 UTC to cleanup old runs
- cron: '0 13 * * *'

permissions: {}
permissions:
contents: write
issues: write
pull-requests: write
actions: write

jobs:
backport:
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/backport to') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
runs-on: ubuntu-24.04
permissions:
contents: write
issues: write
pull-requests: write

steps:
- name: Extract backport target branch
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
id: target-branch-extractor
with:
result-encoding: string
script: |
if (context.eventName !== "issue_comment") throw "Error: This action only works on issue_comment events.";

// extract the target branch name from the trigger phrase containing these characters: a-z, A-Z, digits, forward slash, dot, hyphen, underscore
const regex = /\/backport to ([a-zA-Z\d\/\.\-\_]+)/;
target_branch = regex.exec(context.payload.comment.body);
if (target_branch == null) throw "Error: No backport branch found in the trigger phrase.";

return target_branch[1];
- name: Post backport started comment to pull request
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
with:
script: |
const backport_start_body = `Started backporting to ${{ steps.target-branch-extractor.outputs.result }}: https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`;
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: backport_start_body
});
- name: Checkout repo
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
persist-credentials: true # We need to persist credentials to push the resulting changes upstream.
fetch-depth: 0
- name: Run backport
uses: ./eng/actions/backport
with:
target_branch: ${{ steps.target-branch-extractor.outputs.result }}
auth_token: ${{ secrets.GITHUB_TOKEN }}
exclude: 'documentation/**.md'
label: backport
if: ${{ contains(github.event.comment.body, '/backport to') || github.event_name == 'schedule' }}
uses: dotnet/arcade/.github/workflows/backport-base.yml@main
2 changes: 1 addition & 1 deletion .github/workflows/scan-for-to-do-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
COMMENT_AUTHOR: ${{ github.event.comment.user.login }}

- name: Upload artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
with:
name: issue-todo
path: issue/
6 changes: 3 additions & 3 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ jobs:
with:
persist-credentials: false

- uses: streetsidesoftware/cspell-action@dcd03dc3e8a59ec2e360d0c62db517baa0b4bb6d
- uses: streetsidesoftware/cspell-action@76c6f6d52abd57f4bcab5f3fde1bbd4f19a99eb0
name: Documentation spellcheck
if: ${{ !cancelled() }}
with:
files: '**/*.md'
inline: error
incremental_files_only: true

- uses: streetsidesoftware/cspell-action@dcd03dc3e8a59ec2e360d0c62db517baa0b4bb6d
- uses: streetsidesoftware/cspell-action@76c6f6d52abd57f4bcab5f3fde1bbd4f19a99eb0
name: Resx spellcheck
if: ${{ !cancelled() }}
with:
files: 'src/**/*.resx'
inline: error
incremental_files_only: true

- uses: streetsidesoftware/cspell-action@dcd03dc3e8a59ec2e360d0c62db517baa0b4bb6d
- uses: streetsidesoftware/cspell-action@76c6f6d52abd57f4bcab5f3fde1bbd4f19a99eb0
name: Source code spellcheck
if: ${{ !cancelled() }}
with:
Expand Down
26 changes: 0 additions & 26 deletions eng/actions/backport/action.yml

This file was deleted.

200 changes: 0 additions & 200 deletions eng/actions/backport/index.js

This file was deleted.