Skip to content

Commit

Permalink
Merge pull request #4 from actions/ive-never-normalized-a-thing-in-my…
Browse files Browse the repository at this point in the history
…-life

Allow ./... as a build target
  • Loading branch information
pcarlisle authored Jun 15, 2022
2 parents 054f21a + f2927bc commit 25b8553
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/go-action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Go Action detection of dependencies
on:
push
push:
branches:
- main

jobs:
go-action-detection:
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@ on: # rebuild any PRs and main branch changes
- 'releases/*'

jobs:
build: # make sure build/ci work properly
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
npm ci
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- run: |
npm run all
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://npm.pkg.github.com'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- run: npm rebuild && npm run all
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ function main() {
throw new Error(`${goModPath} is not a go.mod file or does not exist!`);
}
const goModDir = path_1.default.dirname(goModPath);
let goBuildTarget = path_1.default.normalize(core.getInput('go-build-target'));
if (goBuildTarget !== 'all' && goBuildTarget !== '...') {
let goBuildTarget = core.getInput('go-build-target');
if (goBuildTarget !== 'all' && goBuildTarget !== './...') {
if (!fs_1.default.existsSync(goBuildTarget)) {
throw new Error(`The build target '${goBuildTarget}' does not exist`);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ async function main () {
}
const goModDir = path.dirname(goModPath)

let goBuildTarget = path.normalize(core.getInput('go-build-target'))
let goBuildTarget = core.getInput('go-build-target')

if (goBuildTarget !== 'all' && goBuildTarget !== '...') {
if (goBuildTarget !== 'all' && goBuildTarget !== './...') {
if (!fs.existsSync(goBuildTarget)) {
throw new Error(`The build target '${goBuildTarget}' does not exist`)
}
Expand Down

0 comments on commit 25b8553

Please sign in to comment.