-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
94 lines (78 loc) · 3.72 KB
/
Copy pathaction.yml
File metadata and controls
94 lines (78 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: repo-sunsetter
description: "A GitHub Action to prepare a repository for archival"
author: DSACMS
branding:
icon: "sunset"
color: "yellow"
inputs:
GITHUB_TOKEN:
description: "GitHub token for authentication and creating issues & PRs"
required: true
METADATA_FILE_TYPE:
description: "Metadata file in the repository (e.g. code.json, codemeta, publiccode.yml)"
required: false
default: "code.json"
USE_MATURITY_MODEL_TIERS:
description: "Flag to determine if maturity model tiers should be used for issue generation"
required: true
default: "false"
CHECKLIST_LINK:
description: "A link to the archival checklist to be included in the issue body. The checklist must be in the form of a .md file. The link must serve the file as a static raw text file (i.e. uses raw.githubusercontent.com). Only used if USE_MATURITY_MODEL_TIERS is false"
required: false
default: "https://raw.githubusercontent.com/DSACMS/repo-sunsetter/main/checklists/TEMPLATE_ARCHIVAL_CHECKLIST.md"
ARCHIVE_NOTICE_TEXT:
description: "Custom text to include in the archival notice (optional)"
required: false
default: "This project is now archived and no longer actively maintained. It has been archived to retain its contents for reference. Feel free to explore and fork the repository, but please note that updates or support will not be provided."
outputs:
archival_checklist_issue_number:
description: "The created issue number"
value: ${{ steps.create-issue.outputs.issue_number }}
archival_checklist_issue_url:
description: "The URL of the created issue"
value: ${{ steps.create-issue.outputs.issue_url }}
metadata_update_pull_request_url:
description: "The URL of the pull request for the metadata file update"
value: ${{ steps.update-metadata.outputs.pr_url }}
readme_pull_request_number:
description: "The pull request number for the README update"
value: ${{ steps.update-readme.outputs.pull_request_number }}
readme_pull_request_url:
description: "The URL of the pull request for the README update"
value: ${{ steps.update-readme.outputs.pull_request_url }}
runs:
using: "composite"
steps:
- name: Create archival checklist issue
id: create-issue
uses: DSACMS/repo-sunsetter/actions/create-issue@main
with:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
USE_MATURITY_MODEL_TIERS: ${{ inputs.USE_MATURITY_MODEL_TIERS }}
CHECKLIST_LINK: ${{ inputs.CHECKLIST_LINK }}
- name: Update code.json using archival mode
id: update-metadata
if: ${{ inputs.METADATA_FILE_TYPE == 'code.json' }}
uses: DSACMS/automated-codejson-generator@main
with:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
BRANCH: "main"
SKIP_PR: "false"
ARCHIVE: "true"
- name: Update README.md with archival notice
id: update-readme
uses: DSACMS/repo-sunsetter/actions/update-readme@main
with:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
ARCHIVE_NOTICE_TEXT: ${{ inputs.ARCHIVE_NOTICE_TEXT }}
- name: Output results
shell: bash
run: |
echo "🌅 Sunset Summary 🌅"
echo "✅ Archival checklist issue created: #${{ steps.create-issue.outputs.issue_number }} - ${{ steps.create-issue.outputs.issue_url }}"
echo "✅ README update pull request created: #${{ steps.update-readme.outputs.pull_request_number }} - ${{ steps.update-readme.outputs.pull_request_url }}"
if [ -n "${{ steps.update-metadata.outputs.pr_url }}" ]; then
echo "✅ Metadata file update pull request created: ${{ steps.update-metadata.outputs.pr_url }}"
else
echo "ℹ️ No metadata file update pull request created."
fi