Skip to content

Commit

Permalink
Merge pull request #155 from crazy-max/fix-git-context
Browse files Browse the repository at this point in the history
Fix Git context
  • Loading branch information
CrazyMax authored and GitHub committed Oct 3, 2020
2 parents b1b7db3 + c24a92b commit c5789b4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ build-secrets, remote cache, etc. and different builder deployment/namespacing o

### Git context

The default behavior of this action is to use the [Git context invoked by your workflow](https://github.com/docker/build-push-action/blob/master/src/context.ts#L35).
The default behavior of this action is to use the [Git context invoked by your workflow](https://github.com/docker/build-push-action/blob/master/src/context.ts#L10).

```yaml
name: ci
Expand Down
1 change: 0 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ inputs:
context:
description: "Build's context is the set of files located in the specified PATH or URL"
required: false
default: '.'
file:
description: "Path to the Dockerfile"
required: false
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import * as core from '@actions/core';
import * as github from '@actions/github';

export const tmpDir: string = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-build-push-'));
const defaultContext: string = `https://github.com/${github.context.repo.owner}/${github.context.repo.repo}#${github.context.ref}`;
const defaultContext: string = `https://github.com/${github.context.repo.owner}/${
github.context.repo.repo
}.git#${github.context.ref.replace(/^refs\//, '')}`;

export interface Inputs {
context: string;
Expand Down

0 comments on commit c5789b4

Please sign in to comment.