https://github.com/paulfantom/periodic-labeler
GitHub action to periodically label all PRs in repository
https://github.com/paulfantom/periodic-labeler
Last synced: over 1 year ago
JSON representation
GitHub action to periodically label all PRs in repository
- Host: GitHub
- URL: https://github.com/paulfantom/periodic-labeler
- Owner: paulfantom
- License: mit
- Created: 2019-11-19T21:45:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-24T10:56:55.000Z (almost 6 years ago)
- Last Synced: 2025-02-28T10:04:21.572Z (over 1 year ago)
- Language: Go
- Size: 20.5 KB
- Stars: 14
- Watchers: 4
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Periodic Labeler Action
A GitHub action to automatically label all PRs according to file patterns.
📝 *Note: The `pull_request_target` event [added to GitHub Actions](https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/) makes it possible to achieve this without a scheduled workflow. See [this post](https://jclem.net/posts/labeling-prs-on-public-github-repositories) for an example.*
**Table of Contents**
- [Usage](#usage)
## Usage
Action is meant to be run as periodic job. This is needed to workaround issues regarding
[lack of write access when executed from fork](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token#permissions-for-the-github_token)
which is a common problem when using https://github.com/actions/labeler.
```
---
name: Pull request labeler
on:
schedule:
- cron: '*/5 * * * *'
jobs:
labeler:
runs-on: ubuntu-latest
steps:
- uses: paulfantom/periodic-labeler@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
LABEL_MAPPINGS_FILE: .github/labeler.yml
```
By default action uses `.github/labeler.yml` located in repository from `GITHUB_REPOSITORY` as a source of pattern matchers.
This file uses the same schema as in https://github.com/actions/labeler