|
| 1 | +name: 'Store Domain List' |
| 2 | +description: 'Write domain list from repository dispatch events' |
| 3 | + |
| 4 | +inputs: |
| 5 | + bot-email: |
| 6 | + description: 'Email for git config' |
| 7 | + default: '41898282+github-actions[bot]@users.noreply.github.com' |
| 8 | + bot-name: |
| 9 | + description: 'Name for git config' |
| 10 | + default: 'GitHub Action' |
| 11 | + commit-message: |
| 12 | + description: 'Commit message' |
| 13 | + default: '📋 Auto-update domain list' |
| 14 | + branch: |
| 15 | + description: 'Branch to push to' |
| 16 | + default: 'main' |
| 17 | + vote_actions_release: |
| 18 | + description: published version of shared actions |
| 19 | + required: false |
| 20 | + default: snapshot |
| 21 | + |
| 22 | + list_dir: |
| 23 | + description: 'Directory to store reports' |
| 24 | + required: false |
| 25 | + default: 'checklists' |
| 26 | + calendar_dir: |
| 27 | + description: 'Break domain expiry into annual files' |
| 28 | + required: false |
| 29 | + |
| 30 | + domain_list: |
| 31 | + description: 'JSON object containing domain list' |
| 32 | + required: true |
| 33 | + |
| 34 | +outputs: |
| 35 | + updated: |
| 36 | + description: True if changes where made |
| 37 | + value: ${{ steps.commit_push.outputs.updated }} |
| 38 | + |
| 39 | +runs: |
| 40 | + using: "composite" |
| 41 | + steps: |
| 42 | + - name: Setup environment |
| 43 | + uses: ./actions/setup-action-environment |
| 44 | + with: |
| 45 | + bot-email: ${{ inputs.bot-email }} |
| 46 | + bot-name: ${{ inputs.bot-name }} |
| 47 | + vote_actions_release: ${{ inputs.vote_actions_release }} |
| 48 | + |
| 49 | + - name: Process domain data |
| 50 | + shell: bash |
| 51 | + env: |
| 52 | + GITHUB_TOKEN: ${{ github.token }} |
| 53 | + CALENDAR: ${{ inputs.calendar_dir }} |
| 54 | + LIST: ${{ inputs.list_dir }} |
| 55 | + DOMAIN_LIST: ${{ inputs.domain_list }} |
| 56 | + run: | |
| 57 | + node vote-record-actions/dist/domainsWriteList.js |
| 58 | + git add "${LIST}" |
| 59 | +
|
| 60 | + if [ -n "${CALENDAR}" ]; then |
| 61 | + node vote-record-actions/dist/domainsUpdateCalendars.js |
| 62 | + git add "${CALENDAR}" |
| 63 | + fi |
| 64 | +
|
| 65 | + - name: Commit and push changes |
| 66 | + id: commit_push |
| 67 | + uses: ./actions/commit-and-push |
| 68 | + with: |
| 69 | + commit-message: ${{ inputs.commit-message }} |
| 70 | + branch: ${{ inputs.branch }} |
0 commit comments