Skip to content

Add Maintainer as Custom Property to Repositories #27

Add Maintainer as Custom Property to Repositories

Add Maintainer as Custom Property to Repositories #27

# action that runs monthly and add maintainer as a custom property
# to all repositories in this organization
name: Add Maintainer as Custom Property to Repositories
on:
schedule:
- cron: '0 0 27 * *'
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: '20.x'
- id: npm
run: cd ${{ github.workspace }}; npm ci
shell: bash
- name: run
id: run
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
env:
IGNORE_MAINTAINERS: brave-builds,brave-browser-releases,brave-support-admin
DEBUG: false
with:
github-token: ${{ secrets.CUSTOM_PROPERTY_MANAGER_GITHUB_TOKEN }}
script: |
console.log('${{ github.workspace }}/src/addMaintainerCustomProperty.js');
const { default: addMaintainerCustomProperty } = await import('${{ github.workspace }}/src/addMaintainerCustomProperty.js');
return await addMaintainerCustomProperty({
org: process.env.GITHUB_REPOSITORY_OWNER,
github: github,
ignoreMaintainers: process.env.IGNORE_MAINTAINERS,
debug: process.env.DEBUG
});
- uses: actions-ecosystem/action-slack-notifier@fc778468d09c43a6f4d1b8cccaca59766656996a # v1.1.0
if: ${{ fromJson(steps.run.outputs.result) != '' }}
with:
slack_token: ${{ secrets.HOTSPOTS_SLACK_TOKEN }}
message: |
[add-maintainer-custom-property] ${{ fromJson(steps.run.outputs.result) }}
channel: secops-hotspots
color: yellow
verbose: false