Skip to content

Extend action with supporting relative path for portainer be #13

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

Merged
merged 8 commits into from
Feb 17, 2025

Conversation

vanduc2514
Copy link
Contributor

No description provided.

@smashedr
Copy link
Member

This seems logical. I will check this out in my IDE later today and review the docs. You do need to run the build, and I will try to fix the test.

build - you need to run npm build then commit and push the dist directory.
test - I need to figure out how to get the test to use my secrets, I thought this worked at one point...

@vanduc2514
Copy link
Contributor Author

Hi, I already run build and pushed the change, took me a while to firgue out this for it to work. Testing have been done in one of my repository, no issue found, but feel free to test it again on your side.

By the way, I think build on push is useful, and test can be carried through simple api testing with mock.

@vanduc2514 vanduc2514 changed the title Extend action for supporting relative path for portainer be Extend action with supporting relative path for portainer be Feb 16, 2025
@smashedr
Copy link
Member

Hi, I already run build and pushed the change

If the Build was run, there would be a modified dist/index.js in the files changed, and the Test/Build would pass.

After you run npm build you should then be able to commit the changed file.

took me a while to firgue out this for it to work.

Yes, sorry. I will add a CONTRIBUTING.md guide next chance I get. I am literally working on one now for all my actions!

Testing have been done in one of my repository, no issue found, but feel free to test it again on your side.

Yea, I will create a branch to test.

By the way, I think build on push is useful, and test can be carried through simple api testing with mock.

I found out that I now need the pull_request_target, but as you said, I will most likely be looking to setup a mock test or use docker services.

TLDR: I can run and commit the build for you if you can't get it working. I wasted too much time updating another action today and may not get around to this until tomorrow.

@vanduc2514
Copy link
Contributor Author

I forgot to run build again with the latest change, automatic build would be nice. I pushed new build also enabled the cleanup step in workflow for test action

Yea, I will create a branch to test.

Test action run successfull

https://github.com/vanduc2514/portainer-stack-deploy-action/actions/runs/13353255771

Copy link
Member

@smashedr smashedr left a comment

Choose a reason for hiding this comment

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

I requested some changes and suggested another. If you don't have time to make the changes, I can make them myself after I merge.

Again, don't worry about the test failing, I removed that as a requirement and will fix it later.

Other than that it looks solid, thank you for the contribution, and sorry for my spaghetti code and lack of contributing guides.

src/index.js Outdated
if (fs_path) {
// get system info and check if portainer is BE edition
const version = await portainer.getVersion()
const is_portainer_be = version.ServerEdition == 'EE'
Copy link
Member

Choose a reason for hiding this comment

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

While this is not an issue, it should be === and not == when comparing 2 strings.

Suggested change
const is_portainer_be = version.ServerEdition == 'EE'
const is_portainer_be = version.ServerEdition === 'EE'

Copy link
Member

Choose a reason for hiding this comment

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

When this is committed, it should re-trigger the automation without the test and give a ✔️

@smashedr
Copy link
Member

I forgot I cant disable the test, since its combined with the linter and build check. I re-enabled it; however, not sure how to kick them off, their stuck in pending, lol.

Maybe make an arbitrary change in a comment somewhere. Sorry about the confusion.

@vanduc2514 vanduc2514 requested a review from smashedr February 17, 2025 06:51
@vanduc2514
Copy link
Contributor Author

I forgot I cant disable the test, since its combined with the linter and build check. I re-enabled it; however, not sure how to kick them off, their stuck in pending, lol.

Maybe make an arbitrary change in a comment somewhere. Sorry about the confusion.

Happing to me also, for a quick second, I thought the change has something wrong :)) Anyhow, please do your best to re-enable the workflow again for me to be able to merge

@smashedr
Copy link
Member

Happing to me also, for a quick second, I thought the change has something wrong :)) Anyhow, please do your best to re-enable the workflow again for me to be able to merge

I re-enabled them. I think it will take another commit to re-trigger them. Just add or delete any text in a comment in the test.yaml.

If you can't do that, I can temporarily make them not-required to merge.

Copy link

@vanduc2514
Copy link
Contributor Author

Just commented the test job, and the workflow pass run flawlessly. Let's work on that in another time :D

Copy link
Member

@smashedr smashedr left a comment

Choose a reason for hiding this comment

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

🚢 👍

@smashedr smashedr merged commit 72745f1 into cssnr:master Feb 17, 2025
4 checks passed
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.

2 participants