Skip to content

Commit ee0d27f

Browse files
committed
adding contributors workflow
Signed-off-by: vsoch <[email protected]>
1 parent 0477a8d commit ee0d27f

File tree

3 files changed

+113
-0
lines changed

3 files changed

+113
-0
lines changed

.all-contributorsrc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"projectName": "singularity-cli",
3+
"projectOwner": "singularityhub",
4+
"repoType": "github",
5+
"repoHost": "https://github.com",
6+
"files": [
7+
"README.md"
8+
],
9+
"imageSize": 100,
10+
"commit": true,
11+
"commitConvention": "none",
12+
"contributors": [
13+
{
14+
"login": "vsoch",
15+
"name": "Vanessasaurus",
16+
"contributions": [
17+
"code"
18+
],
19+
"profile": "https://vsoch.github.io",
20+
"avatar_url": [
21+
"https://avatars.githubusercontent.com/u/814322?v=4"
22+
]
23+
},
24+
]
25+
"contributorsPerLine": 7
26+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: allcontributors-auto-detect
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
Update:
10+
name: Generate
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v2
15+
- name: Tributors Update
16+
uses: con/tributors@run-twice
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
with:
20+
parsers: unset
21+
update_lookup: github
22+
log_level: DEBUG
23+
force: true
24+
threshold: 1
25+
run_twice: true
26+
27+
- name: Checkout New Branch
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
BRANCH_AGAINST: "main"
31+
run: |
32+
printf "GitHub Actor: ${GITHUB_ACTOR}\n"
33+
export BRANCH_FROM="contributors/update-$(date '+%Y-%m-%d')"
34+
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
35+
36+
BRANCH_EXISTS=$(git ls-remote --heads origin ${BRANCH_FROM})
37+
if [[ -z ${BRANCH_EXISTS} ]]; then
38+
printf "Branch does not exist in remote.\n"
39+
else
40+
printf "Branch already exists in remote.\n"
41+
exit 1
42+
fi
43+
git branch
44+
git checkout -b "${BRANCH_FROM}" || git checkout "${BRANCH_FROM}"
45+
git branch
46+
47+
git config --global user.name "github-actions"
48+
git config --global user.email "[email protected]"
49+
git status
50+
51+
if git diff-index --quiet HEAD --; then
52+
export OPEN_PULL_REQUEST=0
53+
printf "No changes\n"
54+
else
55+
export OPEN_PULL_REQUEST=1
56+
printf "Changes\n"
57+
git commit -a -m "Automated deployment to update contributors $(date '+%Y-%m-%d')"
58+
git push origin "${BRANCH_FROM}"
59+
fi
60+
61+
echo "OPEN_PULL_REQUEST=${OPEN_PULL_REQUEST}" >> $GITHUB_ENV
62+
echo "PULL_REQUEST_FROM_BRANCH=${BRANCH_FROM}" >> $GITHUB_ENV
63+
echo "PULL_REQUEST_TITLE=[tributors] ${BRANCH_FROM}" >> $GITHUB_ENV
64+
echo "PULL_REQUEST_BODY=Tributors update automated pull request." >> $GITHUB_ENV
65+
66+
- name: Open Pull Request
67+
uses: vsoch/[email protected]
68+
if: ${{ env.OPEN_PULL_REQUEST == '1' }}
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
PULL_REQUEST_BRANCH: "main"

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,25 @@ As of version 0.1.0, we only support Singularity > 3.5.2. This is done to encour
1313
newer versions of Singularity with security fixes. If you want to use an older version of Singularity,
1414
you will need to use version 0.0.85 or earlier.
1515

16+
## 😁️ Contributors 😁️
17+
18+
We use the [all-contributors](https://github.com/all-contributors/all-contributors)
19+
tool to generate a contributors graphic below.
20+
21+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
22+
<!-- prettier-ignore-start -->
23+
<!-- markdownlint-disable -->
24+
<!-- markdownlint-restore -->
25+
<!-- prettier-ignore-end -->
26+
27+
<!-- ALL-CONTRIBUTORS-LIST:END -->
28+
29+
30+
1631
## License
1732

1833
This code is licensed under the MPL 2.0 [LICENSE](LICENSE).
1934

2035
## Help and Contribution
36+
2137
Please contribute to the package, or post feedback and questions as <a href="https://github.com/singularityhub/singularity-cli" target="_blank">issues</a>. For points that require discussion of the larger group, please use the <a href="https://groups.google.com/a/lbl.gov/forum/#!forum/singularity" target="_blank">Singularity List</a>

0 commit comments

Comments
 (0)