Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Make the Java label configurable (#130)
Browse files Browse the repository at this point in the history
As discovered in #127
  • Loading branch information
timtebeek authored Jul 17, 2023
1 parent ad20476 commit ea82d13
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/addGitHubOrganization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
org:
description: 'The GH org'
required: true
java:
description: 'The Java column label'
required: false
default: 'java'

env:
GITHUB_TOKEN: ${{secrets.PAT}}
jobs:
Expand All @@ -23,15 +28,18 @@ jobs:
distribution: 'temurin'
java-version: '17'
- name: Adds an org
run: ./add-github-organization.sh ${{ inputs.org }}
run: ./add-github-organization.sh ${{ inputs.org }} ${{ inputs.java }}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
branch: add/${{ inputs.org }}
token: ${{secrets.PAT}}
title: "[Auto] The ${{ inputs.org }} GitHub organization is added"
body: |
[Auto] The ${{ inputs.org }} GitHub organization is added.
commit-message: "[Auto] The ${{ inputs.org }} GitHub organization is added"
labels: enhancement
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
Expand Down
7 changes: 6 additions & 1 deletion add-github-organization.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash
set -ex

gh repo list $1 --language java --no-archived --source --limit 1000 --json nameWithOwner,defaultBranchRef --template '{{range .}},{{.nameWithOwner}},{{.defaultBranchRef.name}},,,java,,,,{{"\n"}}{{end}}' > new.csv
java='java'
if [ -n "$2" ]; then
java=$2
fi

gh repo list $1 --language java --no-archived --source --limit 1000 --json nameWithOwner,defaultBranchRef --template "{{range .}},{{.nameWithOwner}},{{.defaultBranchRef.name}},,,${java},,,,{{\"\n\"}}{{end}}" > new.csv
gh repo list $1 --language python --no-archived --source --limit 1000 --json nameWithOwner,defaultBranchRef --template '{{range .}},{{.nameWithOwner}},{{.defaultBranchRef.name}},,,,,,,{{"\n"}}{{end}}' >> new.csv
gh repo list $1 --language java --archived --source --limit 1000 --json nameWithOwner,defaultBranchRef --template '{{range .}},{{.nameWithOwner}},{{.defaultBranchRef.name}},,,,,,TRUE,archived{{"\n"}}{{end}}' >> new.csv
gh repo list $1 --language python --archived --source --limit 1000 --json nameWithOwner,defaultBranchRef --template '{{range .}},{{.nameWithOwner}},{{.defaultBranchRef.name}},,,,,,TRUE,archived{{"\n"}}{{end}}' >> new.csv
Expand Down

0 comments on commit ea82d13

Please sign in to comment.