0
0
Fork 0
mirror of https://github.com/actions/checkout.git synced 2024-11-23 14:46:24 +01:00

update default branch (#305)

This commit is contained in:
eric sciple 2020-07-14 09:23:30 -04:00 committed by GitHub
parent 61b9e3751b
commit 1433f62caa
Failed to generate hash of commit
8 changed files with 10 additions and 10 deletions

View file

@ -4,7 +4,7 @@ on:
pull_request: pull_request:
push: push:
branches: branches:
- master - main
- releases/* - releases/*
jobs: jobs:

View file

@ -204,7 +204,7 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous
```yaml ```yaml
on: on:
pull_request: pull_request:
branches: [master] branches: [main]
types: [opened, synchronize, closed] types: [opened, synchronize, closed]
jobs: jobs:
build: build:

View file

@ -764,7 +764,7 @@ async function setup(testName: string): Promise<void> {
submodules: false, submodules: false,
nestedSubmodules: false, nestedSubmodules: false,
persistCredentials: true, persistCredentials: true,
ref: 'refs/heads/master', ref: 'refs/heads/main',
repositoryName: 'my-repo', repositoryName: 'my-repo',
repositoryOwner: 'my-org', repositoryOwner: 'my-org',
repositoryPath: '', repositoryPath: '',

View file

@ -20,5 +20,5 @@ else
# Verify auth token # Verify auth token
cd basic cd basic
git fetch --no-tags --depth=1 origin +refs/heads/master:refs/remotes/origin/master git fetch --no-tags --depth=1 origin +refs/heads/main:refs/remotes/origin/main
fi fi

View file

@ -24,7 +24,7 @@ We want to take this opportunity to make behavioral changes, from v1. This docum
description: > description: >
The branch, tag or SHA to checkout. When checking out the repository that The branch, tag or SHA to checkout. When checking out the repository that
triggered a workflow, this defaults to the reference or SHA for that triggered a workflow, this defaults to the reference or SHA for that
event. Otherwise, defaults to `master`. event. Otherwise, uses the default branch.
token: token:
description: > description: >
Personal access token (PAT) used to fetch the repository. The PAT is configured Personal access token (PAT) used to fetch the repository. The PAT is configured
@ -277,7 +277,7 @@ Note:
### Branching strategy and release tags ### Branching strategy and release tags
- Create a servicing branch for V1: `releases/v1` - Create a servicing branch for V1: `releases/v1`
- Merge the changes into `master` - Merge the changes into the default branch
- Release using a new tag `preview` - Release using a new tag `preview`
- When stable, release using a new tag `v2` - When stable, release using a new tag `v2`

4
dist/index.js vendored
View file

@ -5900,7 +5900,7 @@ class GitCommandManager {
/** /**
* Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
* For an annotated tag, the tag SHA is returned. * For an annotated tag, the tag SHA is returned.
* @param {string} ref For example: 'refs/heads/master' or '/refs/tags/v1' * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
* @returns {Promise<string>} * @returns {Promise<string>}
*/ */
revParse(ref) { revParse(ref) {
@ -14545,7 +14545,7 @@ function getInputs() {
result.ref = github.context.ref; result.ref = github.context.ref;
result.commit = github.context.sha; result.commit = github.context.sha;
// Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event), // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
// the ref is unqualifed like "master" instead of "refs/heads/master". // the ref is unqualifed like "main" instead of "refs/heads/main".
if (result.commit && result.ref && !result.ref.startsWith('refs/')) { if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
result.ref = `refs/heads/${result.ref}`; result.ref = `refs/heads/${result.ref}`;
} }

View file

@ -270,7 +270,7 @@ class GitCommandManager {
/** /**
* Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
* For an annotated tag, the tag SHA is returned. * For an annotated tag, the tag SHA is returned.
* @param {string} ref For example: 'refs/heads/master' or '/refs/tags/v1' * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
* @returns {Promise<string>} * @returns {Promise<string>}
*/ */
async revParse(ref: string): Promise<string> { async revParse(ref: string): Promise<string> {

View file

@ -63,7 +63,7 @@ export function getInputs(): IGitSourceSettings {
result.commit = github.context.sha result.commit = github.context.sha
// Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event), // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
// the ref is unqualifed like "master" instead of "refs/heads/master". // the ref is unqualifed like "main" instead of "refs/heads/main".
if (result.commit && result.ref && !result.ref.startsWith('refs/')) { if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
result.ref = `refs/heads/${result.ref}` result.ref = `refs/heads/${result.ref}`
} }