Open trajan0x opened 1 year ago
.github/workflows
to detect changes in action directories.contrib/git-changes-action
to detect changes in .github/actions
.Example workflow:
name: Publish Actions
on:
push:
paths:
- '.github/actions/**'
jobs:
detect-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Detect Changes
uses: ./contrib/git-changes-action
id: changes
- name: Publish Add-Label Action
if: contains(steps.changes.outputs.changed_modules, '.github/actions/add-label')
run: |
git clone https://github.com/your-org/add-label-action.git
cp -r .github/actions/add-label/* add-label-action/
cd add-label-action
git add .
git commit -m 'Update add-label action'
git push
- name: Publish Remove-Label Action
if: contains(steps.changes.outputs.changed_modules, '.github/actions/remove-label')
run: |
git clone https://github.com/your-org/remove-label-action.git
cp -r .github/actions/remove-label/* remove-label-action/
cd remove-label-action
git add .
git commit -m 'Update remove-label action'
git push
- name: Publish Setup-NodeJS Action
if: contains(steps.changes.outputs.changed_modules, '.github/actions/setup-nodejs')
run: |
git clone https://github.com/your-org/setup-nodejs-action.git
cp -r .github/actions/setup-nodejs/* setup-nodejs-action/
cd setup-nodejs-action
git add .
git commit -m 'Update setup-nodejs action'
git push
/.github/actions /.github/workflows /contrib/git-changes-action
Publish actions (composite and contrib) from monorepo into new repos automaitcally so they can be used by other repos