Skip to content

action: Add feature: Allow skip checkout when used along other actions#6

Merged
patrickelectric merged 1 commit intoBlueOS-community:mainfrom
RaulTrombin:allow_skip_checkout
Jan 27, 2025
Merged

action: Add feature: Allow skip checkout when used along other actions#6
patrickelectric merged 1 commit intoBlueOS-community:mainfrom
RaulTrombin:allow_skip_checkout

Conversation

@RaulTrombin
Copy link
Contributor

No description provided.

@ES-Alexander
Copy link
Collaborator

To clarify, my understanding is that git checkout for a branch/tag/commit state that matches the current one does almost nothing, although i'm not sure whether that's the case in the context of an Action.

Are you running into a specific issue that this change solves/reduces? Otherwise it seems like extra complexity of the options users need to understand, for minimal gain.

@RaulTrombin
Copy link
Contributor Author

I'm using this action after another step in a job process that already performs the checkout.
In this particular case,
I need to retrieve some binaries from a previous job and it seems that the checkout cleans everything, but I'll verify this again.

 deploy-blueos:
          needs: [build, build-x86-musl]
          runs-on: ubuntu-22.04
          steps:
            - name: Checkout
              uses: actions/checkout@v4
            - name: Create files directory
              run: mkdir -p ./blueos-ping-viewer-next/files/
            - name: Download armv7 binary
              uses: actions/download-artifact@v4.1.8
              with:
                name: ${{ github.event.repository.name }}-armv7-unknown-linux-musleabihf
                path: ./blueos-ping-viewer-next/files/
            - name: Download aarch64 binary
              uses: actions/download-artifact@v4.1.8
              with:
                name: ${{ github.event.repository.name }}-aarch64-unknown-linux-musl
                path: ./blueos-ping-viewer-next/files/
            - name: Download x86_64 binary
              uses: actions/download-artifact@v4.1.8
              with:
                name: ${{ github.event.repository.name }}-x86_64-unknown-linux-musl
                path: ./blueos-ping-viewer-next/files/
            - name: Prepare binaries
              run: |
                cd ./blueos-ping-viewer-next/files/
                mv ${{ github.event.repository.name }}-armv7-unknown-linux-musleabihf ping-viewer-next.armv7 || echo "Failed to move armv7 binary"
                mv ${{ github.event.repository.name }}-aarch64-unknown-linux-musl ping-viewer-next.aarch64 || echo "Failed to move aarch64 binary"
                mv ${{ github.event.repository.name }}-x86_64-unknown-linux-musl ping-viewer-next.x86_64 || echo "Failed to move x86_64 binary"
                chmod +x ping-viewer-next.* || echo "Failed to chmod binaries"
            - uses: RaulTrombin/Deploy-BlueOS-Extension@main
              name: Deploy BlueOS Extension
              with:
                docker-username: ${{ secrets.DOCKER_USERNAME }}
                docker-password: ${{ secrets.DOCKER_PASSWORD }}
                github-token: ${{ secrets.GITHUB_TOKEN }}
                image-name: ${{ vars.IMAGE_NAME }}
                author: ${{ vars.MY_NAME }}
                author-email: ${{ vars.MY_EMAIL }}
                maintainer: ${{ vars.ORG_NAME }}
                maintainer-email: ${{ vars.ORG_EMAIL }}
                dockerfile-location: "./blueos-ping-viewer-next"
                skip-checkout: 'true'

@RaulTrombin
Copy link
Contributor Author

Can confirm, with checkout it's cleanning folder contents.

------
 > [linux/amd64 5/5] RUN chmod +x /entrypoint.sh &&     if [ "$(uname -m)" = "aarch64" ]; then         cp /ping-viewer-next.aarch64 /ping-viewer-next;     elif [ "$(uname -m)" = "x86_64" ]; then         cp /ping-viewer-next.x86_64 /ping-viewer-next;     else         cp /ping-viewer-next.armv7 /ping-viewer-next;     fi &&     chmod +x /ping-viewer-next &&     rm /ping-viewer-next.*:
0.072 cp: can't stat '/ping-viewer-next.x86_64': No such file or directory
------
Dockerfile:7
--------------------
   6 |     
   7 | >>> RUN chmod +x /entrypoint.sh && \
   8 | >>>     if [ "$(uname -m)" = "aarch64" ]; then \
   9 | >>>         cp /ping-viewer-next.aarch64 /ping-viewer-next; \
  10 | >>>     elif [ "$(uname -m)" = "x86_64" ]; then \
  11 | >>>         cp /ping-viewer-next.x86_64 /ping-viewer-next; \
  12 | >>>     else \
  13 | >>>         cp /ping-viewer-next.armv7 /ping-viewer-next; \
  14 | >>>     fi && \
  15 | >>>     chmod +x /ping-viewer-next && \
  16 | >>>     rm /ping-viewer-next.*
  17 |     LABEL version="0.0.0"
--------------------
ERROR: failed to solve: process "/bin/sh -c chmod +x /entrypoint.sh &&     if [ \"$(uname -m)\" = \"aarch64\" ]; then         cp /ping-viewer-next.aarch64 /ping-viewer-next;     elif [ \"$(uname -m)\" = \"x86_64\" ]; then         cp /ping-viewer-next.x86_64 /ping-viewer-next;     else         cp /ping-viewer-next.armv7 /ping-viewer-next;     fi &&     chmod +x /ping-viewer-next &&     rm /ping-viewer-next.*" did not complete successfully: exit code: 1
Error: Process completed with exit code 1.

Copy link
Collaborator

@ES-Alexander ES-Alexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rebase this one over main, so we can merge without conflicts? :-)

Co-authored-by: ES-Alexander <sandman.esalexander@gmail.com>
@patrickelectric patrickelectric merged commit ff52f83 into BlueOS-community:main Jan 27, 2025
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

Successfully merging this pull request may close these issues.

3 participants