Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Use Github Actions 'checkout@v2' instead of v1 to prevent CI re-run errors #77

Closed
geerlingguy opened this issue Apr 21, 2020 · 4 comments · Fixed by #78
Closed

Use Github Actions 'checkout@v2' instead of v1 to prevent CI re-run errors #77

geerlingguy opened this issue Apr 21, 2020 · 4 comments · Fixed by #78
Labels
type/bug Something isn't working

Comments

@geerlingguy
Copy link
Collaborator

geerlingguy commented Apr 21, 2020

SUMMARY

Testing the PR #61, I've found errors like:

git checkout --progress --force 29436c4030820f6feb760e730d09c2d819ee5a57
##[error]fatal: reference is not a tree: 29436c4030820f6feb760e730d09c2d819ee5a57
##[error]Git checkout failed with exit code: 128
##[error]Exit code 1 returned from process: file name '/home/runner/runners/2.169.0/bin/Runner.PluginHost', arguments 'action "GitHub.Runner.Plugins.Repository.v1_0.CheckoutTask, Runner.Plugins"'.

It seems like that was tracked in actions/checkout#23, and that issue recommends upgrading to the checkout action v2 (we're currently using v1). I don't believe this will break anything in our CI workflow, but it should lead to better stability when re-running failed jobs like I was doing for the PR linked earlier.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

CI

@geerlingguy
Copy link
Collaborator Author

PR created: #78

@geerlingguy
Copy link
Collaborator Author

With v2 pathing I'm getting:

.
└── ansible_collections
    └── community
        └── kubernetes
            ├── CHANGELOG.md
            ├── LICENSE
            ├── README.md
            ├── codecov.yml
            ├── galaxy.yml
            ├── molecule
            │   └── default
            │       ├── converge.yml
            │       ├── molecule.yml
            │       ├── tasks
            │       │   ├── append_hash.yml
            │       │   ├── apply.yml
            │       │   ├── crd.yml
            │       │   ├── delete.yml
            │       │   ├── exec.yml
            │       │   ├── full.yml
            │       │   ├── lists.yml
            │       │   ├── log.yml
            │       │   └── waiter.yml
            │       └── vars
            │           └── main.yml
            ├── plugins
            │   ├── connection
            │   │   └── kubectl.py
            │   ├── doc_fragments
            │   │   ├── __init__.py
            │   │   ├── k8s_auth_options.py
            │   │   ├── k8s_name_options.py
            │   │   ├── k8s_resource_options.py
            │   │   ├── k8s_scale_options.py
            │   │   └── k8s_state_options.py
            │   ├── filter
            │   │   └── k8s.py
            │   ├── inventory
            │   │   ├── k8s.py
            │   │   └── openshift.py
            │   ├── lookup
            │   │   └── k8s.py
            │   ├── module_utils
            │   │   ├── __init__.py
            │   │   ├── common.py
            │   │   ├── raw.py
            │   │   └── scale.py
            │   └── modules
            │       ├── __init__.py
            │       ├── k8s.py
            │       ├── k8s_auth.py
            │       ├── k8s_exec.py
            │       ├── k8s_info.py
            │       ├── k8s_log.py
            │       ├── k8s_scale.py
            │       └── k8s_service.py
            └── tests
                ├── integration
                │   └── targets
                │       └── kubernetes
                │           ├── README.md
                │           ├── aliases
                │           ├── defaults
                │           │   └── main.yml
                │           ├── files
                │           │   ├── crd-resource.yml
                │           │   ├── kuard-extra-property.yml
                │           │   ├── kuard-invalid-type.yml
                │           │   └── setup-crd.yml
                │           ├── handlers
                │           │   └── main.yml
                │           ├── library
                │           │   ├── README.md
                │           │   └── test_tempfile.py
                │           ├── meta
                │           │   └── main.yml
                │           └── tasks
                │               ├── main.yml
                │               ├── older_openshift_fail.yml
                │               ├── openshift.yml
                │               ├── setup_remote_tmp_dir.yml
                │               ├── validate_installed.yml
                │               └── validate_not_installed.yml
                └── sanity
                    ├── ignore-2.10.txt
                    └── ignore-2.9.txt

26 directories, 59 files
ERROR: The current working directory must be at or below:

 - an Ansible collection: {...}/ansible_collections/{namespace}/{collection}/

Current working directory: /home/runner/work/kubernetes/kubernetes
##[error]Process completed with exit code 1.

@geerlingguy
Copy link
Collaborator Author

checkout@v1 apparently drops you into the checkout directory (instead of the github actions working directory):

.
├── CHANGELOG.md
├── LICENSE
├── README.md
├── codecov.yml
├── galaxy.yml
├── molecule
│   └── default
│       ├── converge.yml
│       ├── molecule.yml
│       ├── tasks
│       │   ├── append_hash.yml
│       │   ├── apply.yml
│       │   ├── crd.yml
│       │   ├── delete.yml
│       │   ├── exec.yml
│       │   ├── full.yml
│       │   ├── lists.yml
│       │   ├── log.yml
│       │   └── waiter.yml
│       └── vars
│           └── main.yml
├── plugins
│   ├── connection
│   │   └── kubectl.py
│   ├── doc_fragments
│   │   ├── __init__.py
│   │   ├── k8s_auth_options.py
│   │   ├── k8s_name_options.py
│   │   ├── k8s_resource_options.py
│   │   ├── k8s_scale_options.py
│   │   └── k8s_state_options.py
│   ├── filter
│   │   └── k8s.py
│   ├── inventory
│   │   ├── k8s.py
│   │   └── openshift.py
│   ├── lookup
│   │   └── k8s.py
│   ├── module_utils
│   │   ├── __init__.py
│   │   ├── common.py
│   │   ├── raw.py
│   │   └── scale.py
│   └── modules
│       ├── __init__.py
│       ├── k8s.py
│       ├── k8s_auth.py
│       ├── k8s_exec.py
│       ├── k8s_info.py
│       ├── k8s_log.py
│       ├── k8s_scale.py
│       └── k8s_service.py
└── tests
    ├── integration
    │   └── targets
    │       └── kubernetes
    │           ├── README.md
    │           ├── aliases
    │           ├── defaults
    │           │   └── main.yml
    │           ├── files
    │           │   ├── crd-resource.yml
    │           │   ├── kuard-extra-property.yml
    │           │   ├── kuard-invalid-type.yml
    │           │   └── setup-crd.yml
    │           ├── handlers
    │           │   └── main.yml
    │           ├── library
    │           │   ├── README.md
    │           │   └── test_tempfile.py
    │           ├── meta
    │           │   └── main.yml
    │           └── tasks
    │               ├── main.yml
    │               ├── older_openshift_fail.yml
    │               ├── openshift.yml
    │               ├── setup_remote_tmp_dir.yml
    │               ├── validate_installed.yml
    │               └── validate_not_installed.yml
    └── sanity
        ├── ignore-2.10.txt
        └── ignore-2.9.txt

23 directories, 59 files

So for v2, I'll need to manually cd into the checkout dir, it seems?

@geerlingguy
Copy link
Collaborator Author

Found actions/checkout#167

It looks like you have to manually set the working-directory: [path here] for every run step now:

It is by design to do that so you could put multiple repos SxS and have a consistent knowledge of the working directory. You can set the working directory on the run step so you don't have to CD in your scripts https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun.

We have discussed being able to set the shell and the working-directory at the job level so you don't have to repeat it multiple times.

Annoying but acceptable...

geerlingguy added a commit that referenced this issue Apr 21, 2020
Fixes #77: Update checkout action to v2 for CI stability.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant