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

Using custom version generated from a previous step shows a warning #33

Open
kareemaljabr opened this issue Sep 2, 2022 · 2 comments
Open

Comments

@kareemaljabr
Copy link

kareemaljabr commented Sep 2, 2022

I'm using this action like the following, which is the custom version way.


name: Create Tag

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Maven Version
        id: get-version
        uses: JActions/[email protected]
      - uses: ButlerLogic/[email protected]
        env:
          GITHUB_TOKEN: "${{ github.token }}"
        with:
          version: "v${{ steps.get-version.outputs.version }}"

So I am reading a version from get-version step which reads it from a pom.xml file. I'm getting errors and a tag is not generated.

Warning:
Attempting to use package version extraction strategy.

Warning:
package.json does not exist at /github/workspace/package.json.

Warning:
Error: package.json does not exist at /github/workspace/package.json. at new Package (file:///app/lib/package.js:13:13) at run (file:///app/main.js:33:20) at file:///app/main.js:89:1 at ModuleJob.run (internal/modules/esm/module_job.js:110:37) at async Loader.import (internal/modules/esm/loader.js:179:24)

@kareemaljabr kareemaljabr changed the title Using version shows a Using custom version generated from a previous step shows a warning Sep 2, 2022
@coreybutler
Copy link
Collaborator

I've added a hotfix in master (26b90b1) that should resolve this. You'll need to use ButlerLogic/action-autotag@master to test.

@seunaa
Copy link

seunaa commented Oct 14, 2022

@coreybutler

I'm using the actions like this using butlerlogic/action-autotag@master after getting the tag from a previous action get-version as shown below:

name:  Tag

on:
  push:
    branches:
      - main

jobs:
  publish:
    name: Publish
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2
  
      - name: get version from file
        id: get-version
        uses: jbutcher5/[email protected]
        with:
          file: "path-to/my-file.yaml"
          key-path: '["key1", "key2"]'
  
      - name: display get-version output
        run: echo "${{ steps.get-version.outputs.data }}"
  
      - name: push git tag
        id: push-git-tag
        uses: butlerlogic/action-autotag@master
        env:
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
        with:
          version: "${{ steps.get-version.outputs.data }}"

The tag (0.0.7) extracted in previous action from the .yaml file was passed to version and is being picked up as shown in the logs. However I get the warnings below and no tagging of the repo:


Run butlerlogic/action-autotag@master
  with:
    version: 0.0.7
    root: ./
    strategy: package
    min_version: 0.0.1
  env:
    AWS_REGION: ***
    ECR_REPOSITORY: ***
    AZURE_HTTP_USER_AGENT: 
    AZUREPS_HOST_ENVIRONMENT: 
    AWS_DEFAULT_REGION: ***
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
    GITHUB_TOKEN: ***
Warning: package.json does not exist at /home/runner/work/myproject/package.json.
Warning: Error: package.json does not exist at /home/runner/work/myproject/package.json.
    at new Package (/home/runner/work/_actions/butlerlogic/action-autotag/master/dist/main.js:27033:13)
    at run (/home/runner/work/_actions/butlerlogic/action-autotag/master/dist/main.js:27241:21)
    at Object.<anonymous> (/home/runner/work/_actions/butlerlogic/action-autotag/master/dist/main.js:27309:1)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants