mattermost / mattermost-plugin-starter-template

Build scripts and templates for writing Mattermost plugins.
https://developers.mattermost.com/extend/plugins/
Apache License 2.0
128 stars 120 forks source link

fix: Fix conditions for using secrets on forks. #184

Closed toninis closed 1 year ago

toninis commented 1 year ago

Summary

This should fix any future plugin creations from this template.

Fixes https://github.com/mattermost/mattermost-plugin-starter-template/issues/179

codecov-commenter commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (b874f47) 5.26% compared to head (50562ed) 5.26%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #184 +/- ## ====================================== Coverage 5.26% 5.26% ====================================== Files 3 3 Lines 38 38 ====================================== Hits 2 2 Misses 36 36 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

toninis commented 1 year ago

Thanks for taking a look at the contributor's issue 👍

Can you please elaborate on how this PR fixes the original issue of missing AWS keys?

AWS keys are not missing they just cannot be accessed from forked PRs . This ensures that access to AWS keys is only allowed when CI is running on master/main or tags . We will not run the CD part during the PR so you won't have this issue.

hanzei commented 1 year ago

This ensures that access to AWS keys is only allowed when CI is running on master/main or tags .

Does that mean CD runs on master/main? Does that cause an issue if the AWS keys are not yet?

On another note: The previous circleCI pipeline that was configured in this repos allowed community members to simply fork the repo and start using it - even for building their own releases- E.g. https://github.com/matterpoll/matterpoll/blob/master/.circleci/config.yml is one of the community projects. How can they use the new GH actions workflow to cut releases without requiring an AWS account?

toninis commented 1 year ago

Still causes this issue for community repos outside Mattermost org . I do not know why we enforce AWS push on the plugins since I was not part of the decision. In order to facilitate also community we should remove the AWS part completely since this is something we use .

We can just comment out the cd part and conditionally add it if the plugin is maintained from within Mattermost org . 0/5 on this since I do not have any requirements on this project.

toninis commented 1 year ago

@hanzei this PR https://github.com/mattermost/actions-workflows/pull/28 will probably resolve the issue together with this one

hanzei commented 1 year ago

@toninis The solution in https://github.com/mattermost/actions-workflows/pull/28 looks good to me, thanks :+1:

toninis commented 1 year ago

Colsing this for now . If we have any other issue we will address it .