Skip to content

Issues Templates and Labels (#9) #22

Issues Templates and Labels (#9)

Issues Templates and Labels (#9) #22

# Assign labels from json definition to all repos
# This uses https://github.com/Financial-Times/github-label-sync
# The GITHUB_TOKEN only grants access to the current directory.
# Check https://github.com/orgs/community/discussions/46566
# if they have added a feature to allow access to all organization repositories.
# Until then we use the ISSUE_WRITE_TOKEN which was generated by pylhctokens,
# but is only valid for a limited amount of time (1 year).
# It's a fine-grained token with write access to Issues and PRs, as required.
name: Assign labels to all repos
on: # Runs on any push event in a PR or any push event to master
push:
branches:
- 'master'
defaults:
run:
shell: bash
jobs:
assign-labels:
permissions: # permissions for the GITHUB_TOKEN
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install github-label-sync
run: |
npm install -g github-label-sync
- name: Assign labels into all repos
working-directory: ./labels # labels.json is default filename for github-label-sync
env:
# GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACCESS_TOKEN: ${{ secrets.ISSUE_WRITE_TOKEN }}
run: |
github-label-sync pylhc/.github
github-label-sync pylhc/optics_functions
github-label-sync pylhc/omc3
github-label-sync pylhc/omc3_gui
github-label-sync pylhc/tfs
github-label-sync pylhc/pylhc.github.io
github-label-sync pylhc/submitter
github-label-sync pylhc/turn_by_turn
github-label-sync pylhc/PyLHC
github-label-sync pylhc/sdds
github-label-sync pylhc/generic_parser
github-label-sync pylhc/MESS
github-label-sync pylhc/ir_dodecapole_corrections
github-label-sync pylhc/irnl_rdt_correction
github-label-sync pylhc/accelerator_timeline