Quarterly recurring tickets #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: Quarterly recurring tickets | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: 0 1 1 1,4,7,10 * | |
| jobs: | |
| create_issue: | |
| name: Salesforce sync 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: "QUARTERLY: Sync journals with Salesforce" | |
| BODY: | | |
| `bundle exec rails journals:check_salesforce_sync -- --dry_run=false` | |
| (created by `recurring_tasks_quarterly.yml`) | |
| PINNED: false | |
| CLOSE_PREVIOUS: true | |
| create_issue2: | |
| name: Journal clean 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: "QUARTERLY: Clean unmatched journals" | |
| BODY: | | |
| See https://github.com/datadryad/dryad-app/blob/main/documentation/apis/journals.md#cleaning-journals | |
| (created by `recurring_tasks_quarterly.yml`) | |
| PINNED: false | |
| CLOSE_PREVIOUS: true | |
| create_issue3: | |
| name: Gem update 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: "QUARTERLY: Update gem dependencies" | |
| BODY: | | |
| (created by `recurring_tasks_quarterly.yml`) | |
| PINNED: false | |
| CLOSE_PREVIOUS: true |