Use $default-branch token
This commit is contained in:
+2
-2
@@ -2,9 +2,9 @@ name: Android CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+2
-2
@@ -5,9 +5,9 @@ name: Java CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+3
-3
@@ -3,12 +3,12 @@
|
|||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
# 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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
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
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: C/C++ CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: Clojure CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: Crystal CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: Dart CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: Django CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: Docker Image CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ name: Docker
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
# Publish `master` as Docker `latest` image.
|
# Publish `$default-branch` as Docker `latest` image.
|
||||||
branches:
|
branches:
|
||||||
- master
|
- $default-branch
|
||||||
|
|
||||||
# Publish `v1.2.3` tags as releases.
|
# Publish `v1.2.3` tags as releases.
|
||||||
tags:
|
tags:
|
||||||
@@ -56,7 +56,7 @@ jobs:
|
|||||||
- name: Push image
|
- name: Push image
|
||||||
run: |
|
run: |
|
||||||
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
|
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
|
||||||
|
|
||||||
# Change all uppercase to lowercase
|
# Change all uppercase to lowercase
|
||||||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
|
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ jobs:
|
|||||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
||||||
|
|
||||||
# Use Docker `latest` tag convention
|
# Use Docker `latest` tag convention
|
||||||
[ "$VERSION" == "master" ] && VERSION=latest
|
[ "$VERSION" == "$default-branch" ] && VERSION=latest
|
||||||
|
|
||||||
echo IMAGE_ID=$IMAGE_ID
|
echo IMAGE_ID=$IMAGE_ID
|
||||||
echo VERSION=$VERSION
|
echo VERSION=$VERSION
|
||||||
|
|||||||
@@ -11,22 +11,22 @@
|
|||||||
# To configure this workflow:
|
# To configure this workflow:
|
||||||
#
|
#
|
||||||
# 1. Configure environment variables
|
# 1. Configure environment variables
|
||||||
# GitHub sets default environment variables for every workflow run.
|
# GitHub sets default environment variables for every workflow run.
|
||||||
# Replace the variables relative to your project in the "env" section below.
|
# Replace the variables relative to your project in the "env" section below.
|
||||||
#
|
#
|
||||||
# 2. Signing
|
# 2. Signing
|
||||||
# Generate a signing certificate in the Windows Application
|
# Generate a signing certificate in the Windows Application
|
||||||
# Packaging Project or add an existing signing certificate to the project.
|
# Packaging Project or add an existing signing certificate to the project.
|
||||||
# Next, use PowerShell to encode the .pfx file using Base64 encoding
|
# Next, use PowerShell to encode the .pfx file using Base64 encoding
|
||||||
# by running the following Powershell script to generate the output string:
|
# by running the following Powershell script to generate the output string:
|
||||||
#
|
#
|
||||||
# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte
|
# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte
|
||||||
# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'
|
# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'
|
||||||
#
|
#
|
||||||
# Open the output file, SigningCertificate_Encoded.txt, and copy the
|
# Open the output file, SigningCertificate_Encoded.txt, and copy the
|
||||||
# string inside. Then, add the string to the repo as a GitHub secret
|
# string inside. Then, add the string to the repo as a GitHub secret
|
||||||
# and name it "Base64_Encoded_Pfx."
|
# and name it "Base64_Encoded_Pfx."
|
||||||
# For more information on how to configure your signing certificate for
|
# For more information on how to configure your signing certificate for
|
||||||
# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing
|
# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing
|
||||||
#
|
#
|
||||||
# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key".
|
# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key".
|
||||||
@@ -40,9 +40,9 @@ name: .NET Core Desktop
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
configuration: [Debug, Release]
|
configuration: [Debug, Release]
|
||||||
|
|
||||||
runs-on: windows-latest # For a list of available runner types, refer to
|
runs-on: windows-latest # For a list of available runner types, refer to
|
||||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
|
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: .NET Core
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+3
-3
@@ -2,10 +2,10 @@ name: Elixir CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: Erlang CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: Ruby Gem
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ name: Go
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -5,9 +5,9 @@ name: Java CI with Gradle
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: Haskell CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: Jekyll site CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+3
-3
@@ -2,15 +2,15 @@ name: Laravel
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
laravel-tests:
|
laravel-tests:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Copy .env
|
- name: Copy .env
|
||||||
|
|||||||
+2
-2
@@ -5,9 +5,9 @@ name: Java CI with Maven
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+2
-2
@@ -5,9 +5,9 @@ name: Node.js CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+3
-3
@@ -2,9 +2,9 @@ name: PHP Composer
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Validate composer.json and composer.lock
|
- name: Validate composer.json and composer.lock
|
||||||
run: composer validate
|
run: composer validate
|
||||||
|
|
||||||
- name: Cache Composer packages
|
- name: Cache Composer packages
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
|
|||||||
+2
-2
@@ -5,9 +5,9 @@ name: Python application
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ name: Python package
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+2
-2
@@ -9,9 +9,9 @@ name: Ruby
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: Rust
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: Scala CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ name: Swift
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ $default-branch ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+6
-6
@@ -1,7 +1,7 @@
|
|||||||
# This workflow installs the latest version of Terraform CLI and configures the Terraform CLI configuration file
|
# 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
|
# 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
|
# `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
|
# Documentation for `hashicorp/setup-terraform` is located here: https://github.com/hashicorp/setup-terraform
|
||||||
#
|
#
|
||||||
@@ -47,7 +47,7 @@ name: 'Terraform'
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- $default-branch
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
|
# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
|
||||||
- name: Setup Terraform
|
- name: Setup Terraform
|
||||||
uses: hashicorp/setup-terraform@v1
|
uses: hashicorp/setup-terraform@v1
|
||||||
with:
|
with:
|
||||||
@@ -82,9 +82,9 @@ jobs:
|
|||||||
# Generates an execution plan for Terraform
|
# Generates an execution plan for Terraform
|
||||||
- name: Terraform Plan
|
- name: Terraform Plan
|
||||||
run: 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
|
# 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
|
- 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
|
run: terraform apply -auto-approve
|
||||||
|
|||||||
Reference in New Issue
Block a user