WoozyMasta / archimate-ci-image

Archi container image for use in continuous integration pipelines
https://woozymasta.github.io/archimate-ci-image-example/?view=6213
MIT License
40 stars 23 forks source link

Strange error - "does not refer to a commit" #17

Closed DaaN88 closed 9 months ago

DaaN88 commented 9 months ago

Hi, not passing github actions.

In the details output is this:

Run WoozyMasta/archimate-ci-image@5.0.2-1.0.4
  with:
    archiHtmlReportEnabled: true
    archiJasperReportEnabled: true
    archiJasperReportFormats: PDF,DOCX
    archiCsvReportEnabled: false
    archiExportModelEnabled: true
    githubToken: ***
/usr/bin/docker run --name ghcriowoozymastaarchimateciimage50[2](https://github.com/emacsway/grade/actions/runs/6565655427/job/17834651408?pr=13#step:4:2)104_efc4fd --label b7fd71 --workdir /github/workspace --rm -e "INPUT_ARCHIHTMLREPORTENABLED" -e "INPUT_ARCHIJASPERREPORTENABLED" -e "INPUT_ARCHIJASPERREPORTFORMATS" -e "INPUT_ARCHICSVREPORTENABLED" -e "INPUT_ARCHIEXPORTMODELENABLED" -e "INPUT_GITHUBTOKEN" -e "INPUT_ARCHIJASPERREPORTTITLE" -e "INPUT_GITHUBSERVERURL" -e "INPUT_GITHUBPAGESDOMAIN" -e "INPUT_GITHUBPAGESBRANCH" -e "INPUT_GITSUBTREEPREFIX" -e "INPUT_DEBUGACTION" -e "GITHUB_TOKEN" -e "ARCHI_HTML_REPORT_ENABLED" -e "ARCHI_JASPER_REPORT_ENABLED" -e "ARCHI_JASPER_REPORT_FORMATS" -e "ARCHI_JASPER_REPORT_TITLE" -e "ARCHI_CSV_REPORT_ENABLED" -e "ARCHI_EXPORT_MODEL_ENABLED" -e "GITHUB_SERVER_URL" -e "GITHUB_PAGES_DOMAIN" -e "GITHUB_PAGES_BRANCH" -e "GIT_SUBTREE_PREFIX" -e "DEBUG" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/grade/grade":"/github/workspace" ghcr.io/woozymasta/archimate-ci-image:5.0.2-1.0.4
Run Archi report generation in GitHub actions
WARNING: Using incubator modules: jdk.incubator.vector, jdk.incubator.foreign
[LoadModelFromRepositoryProvider] Loading model at /github/workspace
[LoadModelFromRepositoryProvider] Loaded model: 'grade'
[Jasper Reports] Creating Jasper Reports from 'grade' to /github/workspace/.archi_report
[Jasper Reports] Generating Image for View 1 of 5
[Jasper Reports] Generating Image for View 2 of 5
[Jasper Reports] Generating Image for View [3](https://github.com/emacsway/grade/actions/runs/6565655427/job/17834651408?pr=13#step:4:3) of 5
[Jasper Reports] Generating Image for View [4](https://github.com/emacsway/grade/actions/runs/6565655427/job/17834651408?pr=13#step:4:4) of [5](https://github.com/emacsway/grade/actions/runs/6565655427/job/17834651408?pr=13#step:4:5)
[Jasper Reports] Generating Image for View 5 of 5
[Jasper Reports] Creating Jasper Print...
[Jasper Reports] Compiling...
[Jasper Reports] Filling...
[Jasper Reports] Generating PDF...
[Jasper Reports] Generating DOCX...
[Jasper Reports] Cleaning up...
[Jasper Reports] Reports Created!
[HTMLReport] Creating report from 'grade' to /github/workspace/.archi_report
[HTMLReport] Copying files...
[HTMLReport] Copying hints...
[HTMLReport] Creating files...
[HTMLReport] Generating image for View 1 of 5
[HTMLReport] Generating image for View 2 of 5
[HTMLReport] Generating image for View 3 of 5
[HTMLReport] Generating image for View 4 of 5
[HTMLReport] Generating image for View 5 of 5
[HTMLReport] Creating files...
[HTMLReport] Finalising...
[HTMLReport] Report generated!
[Core] Saved model to '/github/workspace/.archi_report/grade.archimate'

Done. Reports saved to /github/workspace/.archi_report

[main f[6](https://github.com/emacsway/grade/actions/runs/6565655427/job/17834651408?pr=13#step:4:6)c844c] Archimate report archi:archi_report
 520 files changed, 44[7](https://github.com/emacsway/grade/actions/runs/6565655427/job/17834651408?pr=13#step:4:7)[9](https://github.com/emacsway/grade/actions/runs/6565655427/job/17834651408?pr=13#step:4:10)6 insertions(+)
 create mode [10](https://github.com/emacsway/grade/actions/runs/6565655427/job/17834651408?pr=13#step:4:11)06[44](https://github.com/emacsway/grade/actions/runs/6565655427/job/17834651408?pr=13#step:4:45) .archi_report/.nojekyll

....

 create mode 100644 .archi_report/lib/jquery-ui-layout/layout-default-1.4.4.css
 create mode 100644 .archi_report/lib/jquery-ui/jquery-ui.min.js
 create mode 100644 .archi_report/lib/jquery/jquery.min.js
'13/merge' does not refer to a commit

where there are dots, there are strings like

These are github actions settings:

archi_report:
    permissions:
      contents: write
      pages: write
    runs-on: ubuntu-latest
    name: Deploy Archi report HTML to GitHub Pages
    steps:
      - name: Check out the repo
        uses: actions/checkout@v4
        env:
          GITHAB_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
        with:
          ref: main

      - name: Deploy Archi report
        id: archi
        uses: WoozyMasta/archimate-ci-image@5.0.2-1.0.4
        with:
          archiHtmlReportEnabled: true
          archiJasperReportEnabled: true
          archiJasperReportFormats: PDF,DOCX
          archiCsvReportEnabled: false
          archiExportModelEnabled: true
          githubToken: ${{ secrets.GITHUB_TOKEN }}

What could be the problem?

WoozyMasta commented 9 months ago

Hi, this will most likely not work during the PR testing phase, configure your archimate action to only run on the master branch.

DaaN88 commented 9 months ago

Hmm, can you please tell me how to do this?

In the 'on:' section, I specified it this way:

name: golangci-lint

on:
  push:
    tags:
      - v*
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
    permissions:
      contents: read
      # Optional: allow read access to pull request. Use with `only-new-issues` option.
      # pull-requests: read
DaaN88 commented 9 months ago

I found solution! :-) In the reporter's job I add the following:

if: github.ref == 'refs/heads/main'

where "main" can also be "master" if necessary (this is the name of the main branch)...