GHA: Only run GHA comment script if PR origin is from FINOS
Describe your change
Previously, when externally-originating PRs are opened, they receive this error:
Run thollander/actions-comment-pull-request@v3
Error: Resource not accessible by integration
This is because externally-originating PRs don't have permission to run that particular script. So, all externally-originating PRs would always fail due to permissions issues.
This PR checks the origin of PR, and does not call the step if it's external.
Related Issue
Resolves https://github.com/finos/FDC3/issues/1519
Contributor License Agreement
- [ ] I acknowledge that a contributor license agreement is required and that I have one in place or will seek to put one in place ASAP.
Review Checklist
- [x] Issue: If a change was made to the FDC3 Standard, was an issue linked above?
- [ ] CHANGELOG: Is a CHANGELOG.md entry included?
- [ ] API changes: Does this PR include changes to any of the FDC3 APIs (
DesktopAgent,Channel,PrivateChannel,Listener,Bridging)?- [ ] Docs & Sources: If yes, were both documentation (/docs) and sources updated?
JSDoc comments on interfaces and types should be matched to the main documentation in /docs - [ ] Conformance tests: If yes, are conformance test definitions (/toolbox/fdc3-conformance) still correct and complete?
Conformance test definitions should cover all required aspects of an FDC3 Desktop Agent implementation, which are usually marked with a MUST keyword, and optional features (SHOULD or MAY) where the format of those features is defined - [ ] Schemas: If yes, were changes applied to the Bridging and FDC3 for Web protocol schemas?
The Web Connection protocol and Desktop Agent Communication Protocol schemas must be able to support all necessary aspects of the Desktop Agent API, while Bridging must support those aspects necessary for Desktop Agents to communicate with each other- [ ] If yes, was code generation (
npm run build) run and the results checked in?
Generated code will be found at/src/api/BrowserTypes.tsand/or/src/bridging/BridgingTypes.ts
- [ ] If yes, was code generation (
- [ ] Docs & Sources: If yes, were both documentation (/docs) and sources updated?
- [ ] Context types: Were new Context type schemas created or modified in this PR?
- [ ] Were the field type conventions adhered to?
- [ ] Was the
BaseContextschema applied viaallOf(as it is in existing types)? - [ ] Was a
titleanddescriptionprovided for all properties defined in the schema? - [ ] Was at least one example provided?
- [ ] Was code generation (
npm run build) run and the results checked in?
Generated code will be found at/src/context/ContextTypes.ts
- [ ] Intents: Were new Intents created in this PR?
- [ ] Were the intent name prefixes and other naming conventions & characteristics adhered to?
- [ ] Was the new intent added to the list in the Intents Overview?
Deploy Preview for fdc3 canceled.
| Name | Link |
|---|---|
| Latest commit | 6684c1f1ed5ce06996b0c56a72d5a91f575e9785 |
| Latest deploy log | https://app.netlify.com/projects/fdc3/deploys/6852a110ba1ba500088958e0 |
Coverage Report
Commit: 6684c1f Base: main@7085ed3
| Type | Base | This PR |
|---|---|---|
| Total Statements Coverage | ||
| Total Branches Coverage | ||
| Total Functions Coverage | ||
| Total Lines Coverage |
Details (changed files)
| File | Statements | Branches | Functions | Lines |
|---|
Details (all files)
| File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|
| packages/fdc3-agent-proxy/src/DesktopAgentProxy.ts | ||||
| packages/fdc3-agent-proxy/src/index.ts | ||||
| packages/fdc3-agent-proxy/src/apps/DefaultAppSupport.ts | ||||
| packages/fdc3-agent-proxy/src/channels/DefaultChannel.ts | ||||
| packages/fdc3-agent-proxy/src/channels/DefaultChannelSupport.ts | ||||
| packages/fdc3-agent-proxy/src/channels/DefaultPrivateChannel.ts | ||||
| packages/fdc3-agent-proxy/src/heartbeat/DefaultHeartbeatSupport.ts | ||||
| packages/fdc3-agent-proxy/src/intents/DefaultIntentResolution.ts | ||||
| packages/fdc3-agent-proxy/src/intents/DefaultIntentSupport.ts | ||||
| packages/fdc3-agent-proxy/src/listeners/AbstractListener.ts | ||||
| packages/fdc3-agent-proxy/src/listeners/DefaultContextListener.ts | ||||
| packages/fdc3-agent-proxy/src/listeners/DefaultIntentListener.ts | ||||
| packages/fdc3-agent-proxy/src/listeners/EventListener.ts | ||||
| packages/fdc3-agent-proxy/src/listeners/HeartbeatListener.ts | ||||
| packages/fdc3-agent-proxy/src/listeners/PrivateChannelEventListener.ts | ||||
| packages/fdc3-agent-proxy/src/messaging/AbstractMessaging.ts | ||||
| packages/fdc3-agent-proxy/src/util/AbstractFDC3Logger.ts | ||||
| packages/fdc3-agent-proxy/src/util/Logger.ts | ||||
| packages/fdc3-agent-proxy/src/util/throwIfUndefined.ts | ||||
| packages/fdc3-get-agent/src/index.ts | ||||
| packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts | ||||
| packages/fdc3-get-agent/src/messaging/message-port.ts | ||||
| packages/fdc3-get-agent/src/sessionStorage/DesktopAgentDetails.ts | ||||
| packages/fdc3-get-agent/src/strategies/DesktopAgentPreloadLoader.ts | ||||
| packages/fdc3-get-agent/src/strategies/FailoverHandler.ts | ||||
| packages/fdc3-get-agent/src/strategies/HelloHandler.ts | ||||
| packages/fdc3-get-agent/src/strategies/IdentityValidationHandler.ts | ||||
| packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts | ||||
| packages/fdc3-get-agent/src/strategies/Timeouts.ts | ||||
| packages/fdc3-get-agent/src/strategies/getAgent.ts | ||||
| packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts | ||||
| packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts | ||||
| packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts | ||||
| packages/fdc3-get-agent/src/ui/NullChannelSelector.ts | ||||
| packages/fdc3-get-agent/src/ui/NullIntentResolver.ts | ||||
| packages/fdc3-get-agent/src/util/Logger.ts | ||||
| packages/fdc3-get-agent/src/util/Uuid.ts | ||||
| packages/fdc3-standard/src/index.ts | ||||
| packages/fdc3-standard/src/api/Errors.ts | ||||
| packages/fdc3-standard/src/api/GetAgent.ts | ||||
| packages/fdc3-standard/src/api/Methods.ts | ||||
| packages/fdc3-standard/src/api/RecommendedChannels.ts | ||||
| packages/fdc3-standard/src/context/ContextType.ts | ||||
| packages/fdc3-standard/src/intents/Intents.ts | ||||
| packages/fdc3-standard/src/internal/contextConfiguration.ts | ||||
| packages/fdc3-standard/src/internal/intentConfiguration.ts | ||||
| packages/fdc3-standard/src/internal/typeHelpers.ts | ||||
| toolbox/fdc3-for-web/fdc3-web-impl/src/BasicFDC3Server.ts | ||||
| toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts | ||||
| toolbox/fdc3-for-web/fdc3-web-impl/src/directory/BasicDirectory.ts | ||||
| toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/BroadcastHandler.ts | ||||
| toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/HeartbeatHandler.ts | ||||
| toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts | ||||
| toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/OpenHandler.ts | ||||
| toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/support.ts |
+1 on codecov
@Roaders and @julianna-ciq this is merged and if you merge main into your open PRs we should be able to see if this is doing the job.
It seems like this isn't working as expected. I created a new PR from my personal repo and the checks still fail:
https://github.com/finos/FDC3/pull/1630
but unfortunately it looks like the check now fails for PRs from branches in teh fion repo as well:
https://github.com/finos/FDC3/pull/1613
@julianna-ciq this didn't work, apparently PRs run in the context of the receiving repository (which is why giving them write access is dangerous), so the value of github.repository is always "finos/FDC3" for a PR, according to co-pilot anyway:
When you receive a pull request from a fork, the value of github.repository in the GitHub Actions context will be the name of the repository where the workflow is running. This means it will reflect the repository of the upstream (original) repository, not the fork.
For example, if the upstream repository is owner/upstream-repo and the pull request comes from a fork fork-owner/fork-repo, the value of github.repository will be owner/upstream-repo.
This is because workflows triggered by pull requests run in the context of the upstream repository where the pull request is opened.
When asked what you should use, it suggests:
You can use the
github.event.pull_request.head.repo.full_namecontext variable in your GitHub Actions workflow to get the full name of the repository from which the pull request was raised. This includes the owner and repository name of the fork.For example, you can access it in your workflow like this:
- name: Get fork repository name run: echo "Forked from: ${{ github.event.pull_request.head.repo.full_name }}" This will output the name of the forked repository, such as username/repository.