https://github.com/elstudio/actions-settings
GitHub Actions to run Probot settings and set defaults
https://github.com/elstudio/actions-settings
github-actions probot-settings
Last synced: about 1 year ago
JSON representation
GitHub Actions to run Probot settings and set defaults
- Host: GitHub
- URL: https://github.com/elstudio/actions-settings
- Owner: elstudio
- License: mit
- Created: 2019-06-26T13:19:32.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-03T14:30:39.000Z (over 3 years ago)
- Last Synced: 2024-03-15T11:21:01.824Z (over 2 years ago)
- Topics: github-actions, probot-settings
- Language: Dockerfile
- Size: 721 KB
- Stars: 18
- Watchers: 2
- Forks: 5
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# actions-settings
GitHub Action to run [Probot settings](https://github.com/probot/settings) to set repository defaults.
This action simply runs probot-settings, which can be used to set up labels, branch protection rules -- pretty much anything on the repository settings tab. Settings are read from a yaml file in the repository.
## Example Use
Example `probot-settings.yml` file:
```yaml
name: Enforce repository settings
on: [push]
jobs:
probot-settings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run probot-settings
uses: elstudio/actions-settings@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
### A fancer example
Let's say you run `probot-settings` just one time. (Which is useful if you're setting up labels when a repository is first created.)
Fancier example `probot-settings.yml` file:
```yaml
name: Enforce repository settings just once
on: [push]
jobs:
probot-settings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run probot-settings
uses: elstudio/actions-settings@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Remove workflow file from master branch
run: rm ./.github/workflows/probot-settings.yml
if: endsWith(github.ref, '/master') && ! endsWith(github.repository, '-template')
- name: Commit changes
uses: elstudio/actions-js-build/commit@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```