Further optimize the rich style of diagnostic message #3751
Workflow file for this run
This file contains hidden or 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: Add all issues and PRs to F# project, assign milestone and labels | |
| on: | |
| issues: | |
| types: | |
| - opened | |
| - transferred | |
| pull_request_target: | |
| types: | |
| - opened | |
| branches: ['main'] | |
| permissions: | |
| issues: write | |
| repository-projects: write | |
| jobs: | |
| cleanup_old_runs: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request_target' | |
| permissions: | |
| actions: write | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Delete old workflow runs | |
| run: | | |
| _UrlPath="/repos/$GITHUB_REPOSITORY/actions/workflows" | |
| _CurrentWorkflowID="$(gh api -X GET "$_UrlPath" | jq '.workflows[] | select(.name == '\""$GITHUB_WORKFLOW"\"') | .id')" | |
| gh api -X GET "$_UrlPath/$_CurrentWorkflowID/runs" --paginate \ | |
| | jq '.workflow_runs[] | select(.status == "completed") | .id' \ | |
| | xargs -I{} gh api -X DELETE "/repos/$GITHUB_REPOSITORY/actions/runs"/{} | |
| apply-label: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request_target' | |
| steps: | |
| - uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| github.rest.issues.addLabels({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| labels: ['Needs-Triage'] | |
| }) | |
| apply-milestone: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request_target' | |
| steps: | |
| - uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| github.rest.issues.update({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| milestone: 29 | |
| }) |