Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update default branch #305

Merged
merged 1 commit into from Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- master
- main
- releases/*

jobs:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -204,7 +204,7 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous
```yaml
on:
pull_request:
branches: [master]
branches: [main]
types: [opened, synchronize, closed]
jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion __test__/git-auth-helper.test.ts
Expand Up @@ -764,7 +764,7 @@ async function setup(testName: string): Promise<void> {
submodules: false,
nestedSubmodules: false,
persistCredentials: true,
ref: 'refs/heads/master',
ref: 'refs/heads/main',
repositoryName: 'my-repo',
repositoryOwner: 'my-org',
repositoryPath: '',
Expand Down
2 changes: 1 addition & 1 deletion __test__/verify-basic.sh
Expand Up @@ -20,5 +20,5 @@ else

# Verify auth token
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
4 changes: 2 additions & 2 deletions adrs/0153-checkout-v2.md
Expand Up @@ -24,7 +24,7 @@ We want to take this opportunity to make behavioral changes, from v1. This docum
description: >
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
event. Otherwise, defaults to `master`.
event. Otherwise, uses the default branch.
token:
description: >
Personal access token (PAT) used to fetch the repository. The PAT is configured
Expand Down Expand Up @@ -277,7 +277,7 @@ Note:
### Branching strategy and release tags

- 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`
- When stable, release using a new tag `v2`

Expand Down
4 changes: 2 additions & 2 deletions dist/index.js
Expand Up @@ -5900,7 +5900,7 @@ class GitCommandManager {
/**
* 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.
* @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>}
*/
revParse(ref) {
Expand Down Expand Up @@ -14545,7 +14545,7 @@ function getInputs() {
result.ref = github.context.ref;
result.commit = github.context.sha;
// 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/')) {
result.ref = `refs/heads/${result.ref}`;
}
Expand Down
2 changes: 1 addition & 1 deletion src/git-command-manager.ts
Expand Up @@ -270,7 +270,7 @@ class GitCommandManager {
/**
* 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.
* @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>}
*/
async revParse(ref: string): Promise<string> {
Expand Down
2 changes: 1 addition & 1 deletion src/input-helper.ts
Expand Up @@ -63,7 +63,7 @@ export function getInputs(): IGitSourceSettings {
result.commit = github.context.sha

// 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/')) {
result.ref = `refs/heads/${result.ref}`
}
Expand Down