Annual recurring tickets (July 1) #15
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
| # Action to create tasks on a set schedule, from | |
| # https://docs.github.com/en/actions/managing-issues-and-pull-requests/scheduling-issue-creation | |
| name: Annual recurring tickets (July 1) | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: 0 1 1 7 * | |
| jobs: | |
| create_issue2: | |
| name: Create helpdesk review ticket | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: Recurring ticket | |
| run: | | |
| if [[ $CLOSE_PREVIOUS == true ]]; then | |
| previous_issue_number=$(gh issue list \ | |
| --label "$LABELS" \ | |
| --search "$TITLE in:title" \ | |
| --json number \ | |
| --jq '.[0].number') | |
| if [[ -n $previous_issue_number ]]; then | |
| gh issue close "$previous_issue_number" | |
| gh issue unpin "$previous_issue_number" | |
| fi | |
| fi | |
| new_issue_url=$(gh issue create \ | |
| --title "$TITLE" \ | |
| --assignee "$ASSIGNEES" \ | |
| --label "$LABELS" \ | |
| --body "$BODY") | |
| if [[ $PINNED == true ]]; then | |
| gh issue pin "$new_issue_url" | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| LABELS: "maintenance" | |
| TITLE: "ANNUAL: Review helpdesk queries to identify common problems" | |
| BODY: | | |
| (created by `recurring_tasks_annual.yml`) | |
| PINNED: false | |
| CLOSE_PREVIOUS: false | |
| create_issue3: | |
| name: Create ROR update ticket | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: ROR ticket | |
| run: | | |
| if [[ $CLOSE_PREVIOUS == true ]]; then | |
| previous_issue_number=$(gh issue list \ | |
| --label "$LABELS" \ | |
| --search "$TITLE in:title" \ | |
| --json number \ | |
| --jq '.[0].number') | |
| if [[ -n $previous_issue_number ]]; then | |
| gh issue close "$previous_issue_number" | |
| gh issue unpin "$previous_issue_number" | |
| fi | |
| fi | |
| new_issue_url=$(gh issue create \ | |
| --title "$TITLE" \ | |
| --assignee "$ASSIGNEES" \ | |
| --label "$LABELS" \ | |
| --body "$BODY") | |
| if [[ $PINNED == true ]]; then | |
| gh issue pin "$new_issue_url" | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| LABELS: "maintenance" | |
| TITLE: "ANNUAL: Send new affiliations to ROR" | |
| BODY: | | |
| (created by `recurring_tasks_annual.yml`) | |
| PINNED: false | |
| CLOSE_PREVIOUS: false |