GitHub Action
rice-action
1.0.0
Latest version
Repository infrastructure as code
GitHub Action for managing repository infrastructure.
This action can be used to manage repository infrastructure.
The following setting groups are supported:
- uses: flex-development/rice-action@<VERSION>
with:
# Location of repository infrastructure configuration file
# default: .github/infrastructure.yml
config: .github/infrastructure.yml
# Personal access token (PAT) used to authenticate GitHub API requests
# default: ${{ github.token }}
token: ${{ secrets.PAT_REPO }}
Update repository infrastructure on push
or workflow_dispatch
when the infrastructure config file (or workflow) is
updated. The user triggering the workflow run (github.actor
) must be a repository admin.
See .github/workflows/infrastructure.yml
for more details.
---
name: infrastructure
on:
create:
branches:
- main
push:
branches:
- main
- release/**
paths:
- .github/infrastructure.yml
- .github/workflows/infrastructure.yml
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
infrastructure:
runs-on: ubuntu-latest
steps:
- id: debug
name: Print environment variables and event payload
uses: hmarr/debug-action@v2.1.0
- id: check-actor-permission
name: Check permission of actor ${{ github.actor }}
uses: actions-cool/check-user-permission@v2.2.0
with:
require: admin
username: ${{ github.actor }}
- id: checkout
name: Checkout ${{ github.ref_name }}
uses: actions/checkout@v3.3.0
with:
persist-credentials: false
ref: ${{ github.ref_name }}
- id: update
if: steps.check-actor-permission.outputs.require-result == 'true'
name: Update repository infrastructure
uses: flex-development/rice-action@<VERSION>
with:
token: ${{ secrets.PAT_REPO }}
Location of repository infrastructure configuration file.
Default:
.github/infrastructure.yml
Personal access token (PAT) used to authenticate GitHub API requests.
Default:
${{ github.token }}
This action is fully typed with TypeScript.
See CONTRIBUTING.md
.