Merge pull request #590 from actions/cschleiden/use-default-branch-token
Use $default-branch token
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# To use this workflow, you will need to set up a .github/labeler.yml
|
||||
# file with configuration. For more information, see:
|
||||
# https://github.com/actions/labeler/blob/master/README.md
|
||||
# https://github.com/actions/labeler
|
||||
|
||||
name: Labeler
|
||||
on: [pull_request]
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Android CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ name: Java CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+3
-3
@@ -3,12 +3,12 @@
|
||||
name: CI
|
||||
|
||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
||||
# events but only for the master branch
|
||||
# events but only for the $default-branch branch
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: C/C++ CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Clojure CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Crystal CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Dart CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Django CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Docker Image CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ name: Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
# Publish `master` as Docker `latest` image.
|
||||
# Publish `$default-branch` as Docker `latest` image.
|
||||
branches:
|
||||
- master
|
||||
- $default-branch
|
||||
|
||||
# Publish `v1.2.3` tags as releases.
|
||||
tags:
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
||||
|
||||
# Use Docker `latest` tag convention
|
||||
[ "$VERSION" == "master" ] && VERSION=latest
|
||||
[ "$VERSION" == "$default-branch" ] && VERSION=latest
|
||||
|
||||
echo IMAGE_ID=$IMAGE_ID
|
||||
echo VERSION=$VERSION
|
||||
|
||||
@@ -40,9 +40,9 @@ name: .NET Core Desktop
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: .NET Core
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Elixir CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Erlang CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Ruby Gem
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@@ -2,9 +2,9 @@ name: Go
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ name: Java CI with Gradle
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Haskell CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Jekyll site CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Laravel
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
laravel-tests:
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ name: Java CI with Maven
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: PHP Composer
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ name: Python application
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@@ -5,9 +5,9 @@ name: Python package
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -9,9 +9,9 @@ name: Ruby
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Rust
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Scala CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ name: Swift
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ $default-branch ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
# This workflow installs the latest version of Terraform CLI and configures the Terraform CLI configuration file
|
||||
# with an API token for Terraform Cloud (app.terraform.io). On pull request events, this workflow will run
|
||||
# `terraform init`, `terraform fmt`, and `terraform plan` (speculative plan via Terraform Cloud). On push events
|
||||
# to the master branch, `terraform apply` will be executed.
|
||||
# to the $default-branch branch, `terraform apply` will be executed.
|
||||
#
|
||||
# Documentation for `hashicorp/setup-terraform` is located here: https://github.com/hashicorp/setup-terraform
|
||||
#
|
||||
@@ -47,7 +47,7 @@ name: 'Terraform'
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- $default-branch
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
@@ -83,8 +83,8 @@ jobs:
|
||||
- name: Terraform Plan
|
||||
run: terraform plan
|
||||
|
||||
# On push to master, build or change infrastructure according to Terraform configuration files
|
||||
# On push to $default-branch, build or change infrastructure according to Terraform configuration files
|
||||
# Note: It is recommended to set up a required "strict" status check in your repository for "Terraform Cloud". See the documentation on "strict" required status checks for more information: https://help.github.com/en/github/administering-a-repository/types-of-required-status-checks
|
||||
- name: Terraform Apply
|
||||
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
||||
if: github.ref == 'refs/heads/$default-branch' && github.event_name == 'push'
|
||||
run: terraform apply -auto-approve
|
||||
|
||||
Reference in New Issue
Block a user