Closed ArthurNRL closed 1 year ago
I'll need some more information if you want help with this, such as the complete workflow and the full logs from the failed workflow run.
It looks like you're using the Action differently than documented since you are using inputs to populate it.
If I had to guess, you are trying to use it in a reusable workflow and not passing the required info from the calling workflow but that's just a guess with the limited information supplied.
Yes sure here you go:
## notify/action.yml
name: Notify
description: |
This action will send a notification to a teams channel.
inputs:
message:
description: 'If true, only checks if cache entry exists and skips download. Does not change save cache behavior.'
required: true
default: false
level:
description: 'If true, only checks if cache entry exists and skips download. Does not change save cache behavior.'
required: false
default: 'info'
token:
description: 'Github token'
required: true
webhook-url:
description: 'Teams webhook uri'
required: true
runs:
using: "composite"
steps:
- name: Send message
uses: mikesprague/teams-incoming-webhook-action@v1.10.3
with:
github-token: ${{ inputs.token }} # this will use the runner's token.
webhook-url: ${{ inputs.webhook-url }}
color: ${{ inputs.level }}
title: ${{ inputs.message }}
deploy-card: true
all reuses look like this:
- name: Notify dedicated teams channel
uses: ./.github/actions/notify
with:
message: 'Build started'
level: 'info'
token: ${{ secrets.GITHUB_TOKEN }}
webhook-url: ${{ secrets.MSTEAMS_WEBHOOK }}
setting git config username and email fixed it, but I'm afraid not everybody in my org has those set
The deploy card uses expected information built dynamically from the commit that initiated the workflow. And setting one's identity in Git is considered standard (and recommended https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup).
NOTE: when I refer to setting Git identity, I mean on the machine that makes the commit (NOT in the GH Actions environment).
That said, if you don't think folks will have Git configured correctly, the deploy card might not be the best choice. You can also use the default/simple card and pass markdown in for formatting. Here's an example I use in another project:
- name: ⛔ Failure Notification
if: ${{ failure() }}
uses: mikesprague/teams-incoming-webhook-action@v1
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.TEAMS_ALERT_WEBHOOK_URL }}
title: Workflow Failure - ${{ env.DISPLAY_NAME }}
message: |
**The last ${{ env.DISPLAY_NAME }} workflow run failed**
Run logs: [${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}})
color: failure
I'm still trying to decide if I'd consider this a bug vs it just being a case of non-standard usage since the deploy card is intended to have the commit author information.
One option is to fork this repo, make the changes that support your use case, and then use your own version in your workflows.
It's also worth noting that since you are using it via reusable workflow that it might not be seeing all the data it needs from the calling workflow. I have not used it in that way as it's less work to call the Action itself then it is to wrap it and call that wrapper.
setting one's identity in Git is considered standard
Yes, mine was set, although my set username/email wasn't a valid github account but a bitbucket one.
Reading through the code it seems like you're just using author
to display it's username/handle, couldn't you get this data from the commit itself? Here's how the commits looks on github(bottom one is with the "incorrect" configs)
It's also worth noting that since you are using it via reusable workflow that it might not be seeing all the data it needs from the calling workflow. I have not used it in that way as it's less work to call the Action itself then it is to wrap it and call that wrapper.
You're correct, I've used the composite action because I was testing different actions and found it was easier changing one place than multiple. But like I've said it works if the git configs are set to a github account
I hear what you are saying about author but this is the first time this has come up.
If you look at the code, I actually ignore it if author is not provided.
If it's provided, it is expected to relate to a GitHub user because it is a GitHub Action running inside a GitHub Workflow on GitHub.com.
I am not pointing that all out to be sarcastic, I am actually unsure how a bitbucket username is showing up inside your GitHub commit reference.
I'd probably need to see the full workflow logs to be more helpful.
Run mikesprague/teams-incoming-webhook-action@v1.10.3
with:
github-token: ***
webhook-url: ***
color: info
title: Build started
deploy-card: true
timezone: America/New_York
env:
color: '17a2b8'
TypeError: Cannot read properties of null (reading 'login')
at populateCard (file:///D:/a/_actions/mikesprague/teams-incoming-webhook-action/v1.10.3/webpack:/teams-incoming-webhook-action/src/lib/cards/deploy.ts:39:1)
Error: Cannot read properties of null (reading 'login')
at file:///D:/a/_actions/mikesprague/teams-incoming-webhook-action/v1.10.3/webpack:/teams-incoming-webhook-action/src/index.ts:97:1
at Generator.next (<anonymous>)
at fulfilled (file:///D:/a/_actions/mikesprague/teams-incoming-webhook-action/v1.10.3/webpack:/teams-incoming-webhook-action/src/index.ts:28:1)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
This was the full error logs. I also get what you're saying, and for me this is solved, and if you want to close it it's fine. I just would do something to handle this and avoid more issues being opened in the future
If this is an actual bug, I want to fix it. I am trying to determine if it is that vs non-standard usage at this point.
Author is retrieved from the commit data by making a REST API call to get it: https://github.com/mikesprague/teams-incoming-webhook-action/blob/53c58630757080e03d00c86b0569640ce9bf630c/src/index.ts#L69-L71.
And, then if login
isn't available it's not output: https://github.com/mikesprague/teams-incoming-webhook-action/blob/53c58630757080e03d00c86b0569640ce9bf630c/src/lib/cards/deploy.ts#L64
There should not be a case where GitHub cannot determine the author. That's why I feel the issue may be that not all the expected data is making it to the Action via your composite workflow.
In your case, it seems author
is not there at all. Again, there really shouldn't be a case where GitHub cannot determine the commit author.
This really feels more like an issue with the composite workflow usage vs an actual "bug" per se.
That said, I can see that a check for existence of author
might handle this. The change is simple enough on my side and something I can publish in a patch release later this morning.
FWIW, the logs still seemed incomplete. I'd have expected something more like this:
2023-04-19T20:07:38.6101143Z Requested labels: ubuntu-latest
2023-04-19T20:07:38.6101396Z Job defined at: mikesprague/teams-incoming-webhook-action/.github/workflows/build-and-test.yml@refs/tags/v1.10.3
2023-04-19T20:07:38.6101484Z Waiting for a runner to pick up this job...
2023-04-19T20:07:39.1708328Z Job is waiting for a hosted runner to come online.
2023-04-19T20:07:42.0167571Z Job is about to start running on the hosted runner: GitHub Actions 3 (hosted)
2023-04-19T20:07:46.4356962Z Current runner version: '2.303.0'
2023-04-19T20:07:46.4383101Z ##[group]Operating System
2023-04-19T20:07:46.4383623Z Ubuntu
2023-04-19T20:07:46.4383950Z 22.04.2
2023-04-19T20:07:46.4384239Z LTS
2023-04-19T20:07:46.4384580Z ##[endgroup]
2023-04-19T20:07:46.4384907Z ##[group]Runner Image
2023-04-19T20:07:46.4385268Z Image: ubuntu-22.04
2023-04-19T20:07:46.4385615Z Version: 20230409.1
2023-04-19T20:07:46.4386160Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230409.1/images/linux/Ubuntu2204-Readme.md
2023-04-19T20:07:46.4386789Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230409.1
2023-04-19T20:07:46.4387287Z ##[endgroup]
2023-04-19T20:07:46.4387641Z ##[group]Runner Image Provisioner
2023-04-19T20:07:46.4388008Z 2.0.139.1
2023-04-19T20:07:46.4388318Z ##[endgroup]
2023-04-19T20:07:46.4389013Z ##[group]GITHUB_TOKEN Permissions
2023-04-19T20:07:46.4389574Z Contents: read
2023-04-19T20:07:46.4389919Z Metadata: read
2023-04-19T20:07:46.4390803Z Pages: write
2023-04-19T20:07:46.4391257Z ##[endgroup]
2023-04-19T20:07:46.4394927Z Secret source: Actions
2023-04-19T20:07:46.4395561Z Prepare workflow directory
2023-04-19T20:07:46.5125728Z Prepare all required actions
2023-04-19T20:07:46.5310746Z Getting action download info
2023-04-19T20:07:46.7143656Z Download action repository 'actions/checkout@v3' (SHA:8e5e7e5ab8b370d6c329ec480221332ada57f0ab)
2023-04-19T20:07:47.0060887Z Download action repository 'actions/upload-artifact@v3' (SHA:0b7f8abb1508181956e8e162db84b466c27e18ce)
2023-04-19T20:07:47.2820854Z Complete job name: test
2023-04-19T20:07:47.3771607Z ##[group]Run actions/checkout@v3
2023-04-19T20:07:47.3771966Z with:
2023-04-19T20:07:47.3772324Z repository: mikesprague/teams-incoming-webhook-action
2023-04-19T20:07:47.3772945Z token: ***
2023-04-19T20:07:47.3773204Z ssh-strict: true
2023-04-19T20:07:47.3773501Z persist-credentials: true
2023-04-19T20:07:47.3773773Z clean: true
2023-04-19T20:07:47.3774028Z fetch-depth: 1
2023-04-19T20:07:47.3774300Z lfs: false
2023-04-19T20:07:47.3774549Z submodules: false
2023-04-19T20:07:47.3774829Z set-safe-directory: true
2023-04-19T20:07:47.3775111Z ##[endgroup]
2023-04-19T20:07:47.6392150Z Syncing repository: mikesprague/teams-incoming-webhook-action
2023-04-19T20:07:47.6394083Z ##[group]Getting Git version info
2023-04-19T20:07:47.6394804Z Working directory is '/home/runner/work/teams-incoming-webhook-action/teams-incoming-webhook-action'
2023-04-19T20:07:47.6396672Z [command]/usr/bin/git version
2023-04-19T20:07:47.6451300Z git version 2.40.0
2023-04-19T20:07:47.6477048Z ##[endgroup]
2023-04-19T20:07:47.6496052Z Temporarily overriding HOME='/home/runner/work/_temp/a2dcdb48-6985-4b60-b87d-87151f3bf401' before making global git config changes
2023-04-19T20:07:47.6496641Z Adding repository directory to the temporary git global config as a safe directory
2023-04-19T20:07:47.6498704Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/teams-incoming-webhook-action/teams-incoming-webhook-action
2023-04-19T20:07:47.6555083Z Deleting the contents of '/home/runner/work/teams-incoming-webhook-action/teams-incoming-webhook-action'
2023-04-19T20:07:47.6563673Z ##[group]Initializing the repository
2023-04-19T20:07:47.6570545Z [command]/usr/bin/git init /home/runner/work/teams-incoming-webhook-action/teams-incoming-webhook-action
2023-04-19T20:07:47.6642455Z hint: Using 'master' as the name for the initial branch. This default branch name
2023-04-19T20:07:47.6643206Z hint: is subject to change. To configure the initial branch name to use in all
2023-04-19T20:07:47.6644130Z hint: of your new repositories, which will suppress this warning, call:
2023-04-19T20:07:47.6644656Z hint:
2023-04-19T20:07:47.6645696Z hint: git config --global init.defaultBranch <name>
2023-04-19T20:07:47.6646197Z hint:
2023-04-19T20:07:47.6647001Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2023-04-19T20:07:47.6647737Z hint: 'development'. The just-created branch can be renamed via this command:
2023-04-19T20:07:47.6648884Z hint:
2023-04-19T20:07:47.6649544Z hint: git branch -m <name>
2023-04-19T20:07:47.6653652Z Initialized empty Git repository in /home/runner/work/teams-incoming-webhook-action/teams-incoming-webhook-action/.git/
2023-04-19T20:07:47.6670236Z [command]/usr/bin/git remote add origin https://github.com/mikesprague/teams-incoming-webhook-action
2023-04-19T20:07:47.6714295Z ##[endgroup]
2023-04-19T20:07:47.6715035Z ##[group]Disabling automatic garbage collection
2023-04-19T20:07:47.6719007Z [command]/usr/bin/git config --local gc.auto 0
2023-04-19T20:07:47.6752350Z ##[endgroup]
2023-04-19T20:07:47.6753035Z ##[group]Setting up auth
2023-04-19T20:07:47.6759610Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2023-04-19T20:07:47.6794027Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2023-04-19T20:07:47.7152205Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2023-04-19T20:07:47.7179259Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2023-04-19T20:07:47.7402796Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2023-04-19T20:07:47.7440507Z ##[endgroup]
2023-04-19T20:07:47.7441608Z ##[group]Fetching the repository
2023-04-19T20:07:47.7449554Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +ba5657134a624e5cc5b319fe3683a727c3677f14:refs/tags/v1.10.3
2023-04-19T20:07:47.9556626Z remote: Enumerating objects: 64, done.
2023-04-19T20:07:47.9562179Z remote: Counting objects: 1% (1/64)
2023-04-19T20:07:47.9563156Z remote: Counting objects: 3% (2/64)
2023-04-19T20:07:47.9563760Z remote: Counting objects: 4% (3/64)
2023-04-19T20:07:47.9564581Z remote: Counting objects: 6% (4/64)
2023-04-19T20:07:47.9565150Z remote: Counting objects: 7% (5/64)
2023-04-19T20:07:47.9565943Z remote: Counting objects: 9% (6/64)
2023-04-19T20:07:47.9566578Z remote: Counting objects: 10% (7/64)
2023-04-19T20:07:47.9567376Z remote: Counting objects: 12% (8/64)
2023-04-19T20:07:47.9567936Z remote: Counting objects: 14% (9/64)
2023-04-19T20:07:47.9569095Z remote: Counting objects: 15% (10/64)
2023-04-19T20:07:47.9569680Z remote: Counting objects: 17% (11/64)
2023-04-19T20:07:47.9570480Z remote: Counting objects: 18% (12/64)
2023-04-19T20:07:47.9571149Z remote: Counting objects: 20% (13/64)
2023-04-19T20:07:47.9571953Z remote: Counting objects: 21% (14/64)
2023-04-19T20:07:47.9572572Z remote: Counting objects: 23% (15/64)
2023-04-19T20:07:47.9573368Z remote: Counting objects: 25% (16/64)
2023-04-19T20:07:47.9573956Z remote: Counting objects: 26% (17/64)
2023-04-19T20:07:47.9574728Z remote: Counting objects: 28% (18/64)
2023-04-19T20:07:47.9575299Z remote: Counting objects: 29% (19/64)
2023-04-19T20:07:47.9576095Z remote: Counting objects: 31% (20/64)
2023-04-19T20:07:47.9576719Z remote: Counting objects: 32% (21/64)
2023-04-19T20:07:47.9577507Z remote: Counting objects: 34% (22/64)
2023-04-19T20:07:47.9578074Z remote: Counting objects: 35% (23/64)
2023-04-19T20:07:47.9578862Z remote: Counting objects: 37% (24/64)
2023-04-19T20:07:47.9579480Z remote: Counting objects: 39% (25/64)
2023-04-19T20:07:47.9580267Z remote: Counting objects: 40% (26/64)
2023-04-19T20:07:47.9580827Z remote: Counting objects: 42% (27/64)
2023-04-19T20:07:47.9581608Z remote: Counting objects: 43% (28/64)
2023-04-19T20:07:47.9582238Z remote: Counting objects: 45% (29/64)
2023-04-19T20:07:47.9583376Z remote: Counting objects: 46% (30/64)
2023-04-19T20:07:47.9583953Z remote: Counting objects: 48% (31/64)
2023-04-19T20:07:47.9584736Z remote: Counting objects: 50% (32/64)
2023-04-19T20:07:47.9585296Z remote: Counting objects: 51% (33/64)
2023-04-19T20:07:47.9586063Z remote: Counting objects: 53% (34/64)
2023-04-19T20:07:47.9586626Z remote: Counting objects: 54% (35/64)
2023-04-19T20:07:47.9587418Z remote: Counting objects: 56% (36/64)
2023-04-19T20:07:47.9587985Z remote: Counting objects: 57% (37/64)
2023-04-19T20:07:47.9588782Z remote: Counting objects: 59% (38/64)
2023-04-19T20:07:47.9589348Z remote: Counting objects: 60% (39/64)
2023-04-19T20:07:47.9590529Z remote: Counting objects: 62% (40/64)
2023-04-19T20:07:47.9591096Z remote: Counting objects: 64% (41/64)
2023-04-19T20:07:47.9592206Z remote: Counting objects: 65% (42/64)
2023-04-19T20:07:47.9593504Z remote: Counting objects: 67% (43/64)
2023-04-19T20:07:47.9594042Z remote: Counting objects: 68% (44/64)
2023-04-19T20:07:47.9594683Z remote: Counting objects: 70% (45/64)
2023-04-19T20:07:47.9595298Z remote: Counting objects: 71% (46/64)
2023-04-19T20:07:47.9595911Z remote: Counting objects: 73% (47/64)
2023-04-19T20:07:47.9596499Z remote: Counting objects: 75% (48/64)
2023-04-19T20:07:47.9597228Z remote: Counting objects: 76% (49/64)
2023-04-19T20:07:47.9597705Z remote: Counting objects: 78% (50/64)
2023-04-19T20:07:47.9598397Z remote: Counting objects: 79% (51/64)
2023-04-19T20:07:47.9599232Z remote: Counting objects: 81% (52/64)
2023-04-19T20:07:47.9599787Z remote: Counting objects: 82% (53/64)
2023-04-19T20:07:47.9600228Z remote: Counting objects: 84% (54/64)
2023-04-19T20:07:47.9600666Z remote: Counting objects: 85% (55/64)
2023-04-19T20:07:47.9601087Z remote: Counting objects: 87% (56/64)
2023-04-19T20:07:47.9602147Z remote: Counting objects: 89% (57/64)
2023-04-19T20:07:47.9602594Z remote: Counting objects: 90% (58/64)
2023-04-19T20:07:47.9603035Z remote: Counting objects: 92% (59/64)
2023-04-19T20:07:47.9603474Z remote: Counting objects: 93% (60/64)
2023-04-19T20:07:47.9603893Z remote: Counting objects: 95% (61/64)
2023-04-19T20:07:47.9604334Z remote: Counting objects: 96% (62/64)
2023-04-19T20:07:47.9604779Z remote: Counting objects: 98% (63/64)
2023-04-19T20:07:47.9605230Z remote: Counting objects: 100% (64/64)
2023-04-19T20:07:47.9605687Z remote: Counting objects: 100% (64/64), done.
2023-04-19T20:07:47.9606345Z remote: Compressing objects: 1% (1/58)
2023-04-19T20:07:47.9606830Z remote: Compressing objects: 3% (2/58)
2023-04-19T20:07:47.9607278Z remote: Compressing objects: 5% (3/58)
2023-04-19T20:07:47.9607756Z remote: Compressing objects: 6% (4/58)
2023-04-19T20:07:47.9608239Z remote: Compressing objects: 8% (5/58)
2023-04-19T20:07:47.9608704Z remote: Compressing objects: 10% (6/58)
2023-04-19T20:07:47.9609168Z remote: Compressing objects: 12% (7/58)
2023-04-19T20:07:47.9609681Z remote: Compressing objects: 13% (8/58)
2023-04-19T20:07:47.9610113Z remote: Compressing objects: 15% (9/58)
2023-04-19T20:07:47.9610555Z remote: Compressing objects: 17% (10/58)
2023-04-19T20:07:47.9610969Z remote: Compressing objects: 18% (11/58)
2023-04-19T20:07:47.9611387Z remote: Compressing objects: 20% (12/58)
2023-04-19T20:07:47.9611793Z remote: Compressing objects: 22% (13/58)
2023-04-19T20:07:47.9825542Z remote: Compressing objects: 24% (14/58)
2023-04-19T20:07:47.9829096Z remote: Compressing objects: 25% (15/58)
2023-04-19T20:07:47.9829516Z remote: Compressing objects: 27% (16/58)
2023-04-19T20:07:47.9831265Z remote: Compressing objects: 29% (17/58)
2023-04-19T20:07:47.9832033Z remote: Compressing objects: 31% (18/58)
2023-04-19T20:07:47.9832426Z remote: Compressing objects: 32% (19/58)
2023-04-19T20:07:47.9832813Z remote: Compressing objects: 34% (20/58)
2023-04-19T20:07:47.9882428Z remote: Compressing objects: 36% (21/58)
2023-04-19T20:07:47.9904170Z remote: Compressing objects: 37% (22/58)
2023-04-19T20:07:47.9941901Z remote: Compressing objects: 39% (23/58)
2023-04-19T20:07:47.9963139Z remote: Compressing objects: 41% (24/58)
2023-04-19T20:07:47.9963539Z remote: Compressing objects: 43% (25/58)
2023-04-19T20:07:47.9963909Z remote: Compressing objects: 44% (26/58)
2023-04-19T20:07:47.9965045Z remote: Compressing objects: 46% (27/58)
2023-04-19T20:07:47.9965642Z remote: Compressing objects: 48% (28/58)
2023-04-19T20:07:47.9966005Z remote: Compressing objects: 50% (29/58)
2023-04-19T20:07:47.9966334Z remote: Compressing objects: 51% (30/58)
2023-04-19T20:07:47.9966950Z remote: Compressing objects: 53% (31/58)
2023-04-19T20:07:47.9967645Z remote: Compressing objects: 55% (32/58)
2023-04-19T20:07:47.9969241Z remote: Compressing objects: 56% (33/58)
2023-04-19T20:07:47.9971458Z remote: Compressing objects: 58% (34/58)
2023-04-19T20:07:47.9973527Z remote: Compressing objects: 60% (35/58)
2023-04-19T20:07:47.9975586Z remote: Compressing objects: 62% (36/58)
2023-04-19T20:07:47.9977560Z remote: Compressing objects: 63% (37/58)
2023-04-19T20:07:47.9979720Z remote: Compressing objects: 65% (38/58)
2023-04-19T20:07:47.9981740Z remote: Compressing objects: 67% (39/58)
2023-04-19T20:07:47.9983680Z remote: Compressing objects: 68% (40/58)
2023-04-19T20:07:47.9985598Z remote: Compressing objects: 70% (41/58)
2023-04-19T20:07:47.9991246Z remote: Compressing objects: 72% (42/58)
2023-04-19T20:07:47.9993631Z remote: Compressing objects: 74% (43/58)
2023-04-19T20:07:47.9994034Z remote: Compressing objects: 75% (44/58)
2023-04-19T20:07:47.9996943Z remote: Compressing objects: 77% (45/58)
2023-04-19T20:07:47.9997279Z remote: Compressing objects: 79% (46/58)
2023-04-19T20:07:48.0001071Z remote: Compressing objects: 81% (47/58)
2023-04-19T20:07:48.0001415Z remote: Compressing objects: 82% (48/58)
2023-04-19T20:07:48.0001762Z remote: Compressing objects: 84% (49/58)
2023-04-19T20:07:48.0002087Z remote: Compressing objects: 86% (50/58)
2023-04-19T20:07:48.0002423Z remote: Compressing objects: 87% (51/58)
2023-04-19T20:07:48.0002757Z remote: Compressing objects: 89% (52/58)
2023-04-19T20:07:48.0003082Z remote: Compressing objects: 91% (53/58)
2023-04-19T20:07:48.0003412Z remote: Compressing objects: 93% (54/58)
2023-04-19T20:07:48.0003730Z remote: Compressing objects: 94% (55/58)
2023-04-19T20:07:48.0004062Z remote: Compressing objects: 96% (56/58)
2023-04-19T20:07:48.0004761Z remote: Compressing objects: 98% (57/58)
2023-04-19T20:07:48.0005274Z remote: Compressing objects: 100% (58/58)
2023-04-19T20:07:48.0005621Z remote: Compressing objects: 100% (58/58), done.
2023-04-19T20:07:48.1374206Z remote: Total 64 (delta 8), reused 35 (delta 2), pack-reused 0
2023-04-19T20:07:48.1498956Z From https://github.com/mikesprague/teams-incoming-webhook-action
2023-04-19T20:07:48.1499868Z * [new ref] ba5657134a624e5cc5b319fe3683a727c3677f14 -> v1.10.3
2023-04-19T20:07:48.1546210Z ##[endgroup]
2023-04-19T20:07:48.1546803Z ##[group]Determining the checkout info
2023-04-19T20:07:48.1547286Z ##[endgroup]
2023-04-19T20:07:48.1547729Z ##[group]Checking out the ref
2023-04-19T20:07:48.1548316Z [command]/usr/bin/git checkout --progress --force refs/tags/v1.10.3
2023-04-19T20:07:48.1740440Z Note: switching to 'refs/tags/v1.10.3'.
2023-04-19T20:07:48.1740747Z
2023-04-19T20:07:48.1741243Z You are in 'detached HEAD' state. You can look around, make experimental
2023-04-19T20:07:48.1743669Z changes and commit them, and you can discard any commits you make in this
2023-04-19T20:07:48.1744314Z state without impacting any branches by switching back to a branch.
2023-04-19T20:07:48.1765390Z
2023-04-19T20:07:48.1766368Z If you want to create a new branch to retain commits you create, you may
2023-04-19T20:07:48.1766981Z do so (now or later) by using -c with the switch command. Example:
2023-04-19T20:07:48.1767211Z
2023-04-19T20:07:48.1767395Z git switch -c <new-branch-name>
2023-04-19T20:07:48.1767583Z
2023-04-19T20:07:48.1767740Z Or undo this operation with:
2023-04-19T20:07:48.1767918Z
2023-04-19T20:07:48.1768014Z git switch -
2023-04-19T20:07:48.1768170Z
2023-04-19T20:07:48.1768391Z Turn off this advice by setting config variable advice.detachedHead to false
2023-04-19T20:07:48.1768651Z
2023-04-19T20:07:48.1768824Z HEAD is now at ba56571 chore(release): prepare release v1.10.3
2023-04-19T20:07:48.1769961Z ##[endgroup]
2023-04-19T20:07:48.1815370Z [command]/usr/bin/git log -1 --format='%H'
2023-04-19T20:07:48.1839531Z 'ba5657134a624e5cc5b319fe3683a727c3677f14'
2023-04-19T20:07:48.2151418Z ##[group]Run npm install && npm run build
2023-04-19T20:07:48.2151826Z [36;1mnpm install && npm run build[0m
2023-04-19T20:07:48.2208904Z shell: /usr/bin/bash -e {0}
2023-04-19T20:07:48.2209208Z ##[endgroup]
2023-04-19T20:07:55.2323699Z npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
2023-04-19T20:07:57.8337982Z
2023-04-19T20:07:57.8338709Z > teams-incoming-webhook-action@1.10.3 prepare
2023-04-19T20:07:57.8339174Z > rm -rf dist && ncc build --source-map --license licenses.txt
2023-04-19T20:07:57.8339373Z
2023-04-19T20:07:58.1258079Z ncc: Version 0.36.1
2023-04-19T20:07:58.1258874Z ncc: Compiling file index.js into ESM
2023-04-19T20:07:58.7786176Z ncc: Using typescript@5.0.4 (local user-provided)
2023-04-19T20:08:03.4403710Z 0kB dist/package.json
2023-04-19T20:08:03.4404703Z 40kB dist/sourcemap-register.cjs
2023-04-19T20:08:03.4405317Z 51kB dist/licenses.txt
2023-04-19T20:08:03.4405928Z 638kB dist/index.js.map
2023-04-19T20:08:03.4406312Z 926kB dist/index.js
2023-04-19T20:08:03.4406717Z 638kB dist/index.js.map
2023-04-19T20:08:03.4407664Z 1655kB [5540ms] - ncc 0.36.1
2023-04-19T20:08:03.5473543Z
2023-04-19T20:08:03.5474068Z added 496 packages, and audited 497 packages in 13s
2023-04-19T20:08:03.5476395Z
2023-04-19T20:08:03.5479152Z 65 packages are looking for funding
2023-04-19T20:08:03.5482063Z run `npm fund` for details
2023-04-19T20:08:03.5499498Z
2023-04-19T20:08:03.5499936Z found 0 vulnerabilities
2023-04-19T20:08:03.9541230Z
2023-04-19T20:08:03.9542368Z > teams-incoming-webhook-action@1.10.3 prebuild
2023-04-19T20:08:03.9542944Z > npm run test
2023-04-19T20:08:03.9543309Z
2023-04-19T20:08:04.3311995Z
2023-04-19T20:08:04.3312815Z > teams-incoming-webhook-action@1.10.3 test
2023-04-19T20:08:04.3313179Z > npm run lint && npm run check
2023-04-19T20:08:04.3313336Z
2023-04-19T20:08:04.7118235Z
2023-04-19T20:08:04.7119326Z > teams-incoming-webhook-action@1.10.3 lint
2023-04-19T20:08:04.7119969Z > eslint ./src
2023-04-19T20:08:04.7120298Z
2023-04-19T20:08:08.3479824Z
2023-04-19T20:08:08.3481024Z /home/runner/work/teams-incoming-webhook-action/teams-incoming-webhook-action/src/index.ts
2023-04-19T20:08:08.3482368Z 101:20 warning Unsafe argument of type `any` assigned to a parameter of type `string` @typescript-eslint/no-unsafe-argument
2023-04-19T20:08:08.3483188Z 105:20 warning Unsafe argument of type `any` assigned to a parameter of type `string` @typescript-eslint/no-unsafe-argument
2023-04-19T20:08:08.3484230Z 106:25 warning Unsafe argument of type `any` assigned to a parameter of type `string | undefined` @typescript-eslint/no-unsafe-argument
2023-04-19T20:08:08.3485035Z 108:19 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
2023-04-19T20:08:08.3486428Z 110:11 warning Unsafe assignment of an `any` value @typescript-eslint/no-unsafe-assignment
2023-04-19T20:08:08.3487293Z 111:20 warning Unsafe argument of type `any` assigned to a parameter of type `string | Error` @typescript-eslint/no-unsafe-argument
2023-04-19T20:08:08.3487923Z
2023-04-19T20:08:08.3488433Z /home/runner/work/teams-incoming-webhook-action/teams-incoming-webhook-action/src/lib/cards/deploy.ts
2023-04-19T20:08:08.3489389Z 6:11 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
2023-04-19T20:08:08.3490103Z 8:11 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
2023-04-19T20:08:08.3491043Z 63:25 warning Invalid type "any" of template literal expression @typescript-eslint/restrict-template-expressions
2023-04-19T20:08:08.3491798Z 63:25 warning Unsafe member access .data on an `any` value @typescript-eslint/no-unsafe-member-access
2023-04-19T20:08:08.3533033Z 64:15 warning Unsafe member access .login on an `any` value @typescript-eslint/no-unsafe-member-access
2023-04-19T20:08:08.3534419Z 64:36 warning Invalid type "any" of template literal expression @typescript-eslint/restrict-template-expressions
2023-04-19T20:08:08.3535431Z 64:36 warning Unsafe member access .login on an `any` value @typescript-eslint/no-unsafe-member-access
2023-04-19T20:08:08.3536446Z 95:17 warning Unsafe assignment of an `any` value @typescript-eslint/no-unsafe-assignment
2023-04-19T20:08:08.3537186Z 95:22 warning Unsafe member access .data on an `any` value @typescript-eslint/no-unsafe-member-access
2023-04-19T20:08:08.3537788Z
2023-04-19T20:08:08.3538139Z ✖ 15 problems (0 errors, 15 warnings)
2023-04-19T20:08:08.3538643Z
2023-04-19T20:08:08.7640354Z
2023-04-19T20:08:08.7645339Z > teams-incoming-webhook-action@1.10.3 check
2023-04-19T20:08:08.7646333Z > tsc --noEmit
2023-04-19T20:08:08.7646636Z
2023-04-19T20:08:14.8355490Z
2023-04-19T20:08:14.8356453Z > teams-incoming-webhook-action@1.10.3 build
2023-04-19T20:08:14.8400018Z > npm run prepare
2023-04-19T20:08:14.8400181Z
2023-04-19T20:08:15.2127316Z
2023-04-19T20:08:15.2128595Z > teams-incoming-webhook-action@1.10.3 prepare
2023-04-19T20:08:15.2129487Z > rm -rf dist && ncc build --source-map --license licenses.txt
2023-04-19T20:08:15.2129992Z
2023-04-19T20:08:15.3482203Z ncc: Version 0.36.1
2023-04-19T20:08:15.3485662Z ncc: Compiling file index.js into ESM
2023-04-19T20:08:15.7363468Z ncc: Using typescript@5.0.4 (local user-provided)
2023-04-19T20:08:19.6380292Z 0kB dist/package.json
2023-04-19T20:08:19.6380901Z 40kB dist/sourcemap-register.cjs
2023-04-19T20:08:19.6381152Z 51kB dist/licenses.txt
2023-04-19T20:08:19.6381392Z 638kB dist/index.js.map
2023-04-19T20:08:19.6381618Z 926kB dist/index.js
2023-04-19T20:08:19.6381841Z 638kB dist/index.js.map
2023-04-19T20:08:19.6382135Z 1655kB [4374ms] - ncc 0.36.1
2023-04-19T20:08:19.7488003Z
2023-04-19T20:08:19.7489814Z > teams-incoming-webhook-action@1.10.3 postbuild
2023-04-19T20:08:19.7490443Z > npm run typedoc-html
2023-04-19T20:08:19.7490774Z
2023-04-19T20:08:20.1271617Z
2023-04-19T20:08:20.1272420Z > teams-incoming-webhook-action@1.10.3 typedoc-html
2023-04-19T20:08:20.1273048Z > typedoc --out ./docs/publish --entryPointStrategy expand ./src --readme ./README.md
2023-04-19T20:08:20.1273330Z
2023-04-19T20:08:27.6170272Z [96m[info][0m Documentation generated at ./docs/publish
2023-04-19T20:08:27.7670346Z ##[group]Run ./
2023-04-19T20:08:27.7670661Z with:
2023-04-19T20:08:27.7671507Z github-token: ***
2023-04-19T20:08:27.7672202Z webhook-url: ***
2023-04-19T20:08:27.7672653Z deploy-card: true
2023-04-19T20:08:27.7672919Z title: Starting Notification Tests
2023-04-19T20:08:27.7673233Z color: info
2023-04-19T20:08:27.7673542Z timezone: America/New_York
2023-04-19T20:08:27.7674108Z ##[endgroup]
2023-04-19T20:08:30.6074130Z ##[group]Run ./
2023-04-19T20:08:30.6074431Z with:
2023-04-19T20:08:30.6074903Z github-token: ***
2023-04-19T20:08:30.6075580Z webhook-url: ***
2023-04-19T20:08:30.6075919Z deploy-card: false
2023-04-19T20:08:30.6076170Z title: Notification Test
2023-04-19T20:08:30.6076554Z message: This is an example of a simple notification with a title and a body
2023-04-19T20:08:30.6076929Z color: default
2023-04-19T20:08:30.6077252Z timezone: America/New_York
2023-04-19T20:08:30.6077495Z ##[endgroup]
2023-04-19T20:08:32.0924979Z ##[group]Run ./
2023-04-19T20:08:32.0925191Z with:
2023-04-19T20:08:32.0925571Z github-token: ***
2023-04-19T20:08:32.0926082Z webhook-url: ***
2023-04-19T20:08:32.0926289Z deploy-card: true
2023-04-19T20:08:32.0926494Z title: Deployment Started
2023-04-19T20:08:32.0926702Z color: info
2023-04-19T20:08:32.0926915Z timezone: America/New_York
2023-04-19T20:08:32.0927126Z ##[endgroup]
2023-04-19T20:08:33.5974631Z ##[group]Run ./
2023-04-19T20:08:33.5974863Z with:
2023-04-19T20:08:33.5975250Z github-token: ***
2023-04-19T20:08:33.5975760Z webhook-url: ***
2023-04-19T20:08:33.5975978Z deploy-card: true
2023-04-19T20:08:33.5976206Z title: Deployment Cancelled
2023-04-19T20:08:33.5976427Z color: warning
2023-04-19T20:08:33.5976631Z timezone: America/New_York
2023-04-19T20:08:33.5976851Z ##[endgroup]
2023-04-19T20:08:35.4165344Z ##[group]Run ./
2023-04-19T20:08:35.4165567Z with:
2023-04-19T20:08:35.4165951Z github-token: ***
2023-04-19T20:08:35.4166461Z webhook-url: ***
2023-04-19T20:08:35.4166683Z deploy-card: true
2023-04-19T20:08:35.4166911Z title: Deployment Failed
2023-04-19T20:08:35.4167136Z color: failure
2023-04-19T20:08:35.4167341Z timezone: America/New_York
2023-04-19T20:08:35.4167563Z ##[endgroup]
2023-04-19T20:08:37.2934346Z ##[group]Run ./
2023-04-19T20:08:37.2934571Z with:
2023-04-19T20:08:37.2934962Z github-token: ***
2023-04-19T20:08:37.2935478Z webhook-url: ***
2023-04-19T20:08:37.2935699Z deploy-card: true
2023-04-19T20:08:37.2935951Z title: Deployment Successful
2023-04-19T20:08:37.2936175Z color: success
2023-04-19T20:08:37.2936381Z timezone: America/New_York
2023-04-19T20:08:37.2936604Z ##[endgroup]
2023-04-19T20:08:38.9001492Z ##[group]Run ./
2023-04-19T20:08:38.9001710Z with:
2023-04-19T20:08:38.9002153Z github-token: ***
2023-04-19T20:08:38.9002674Z webhook-url: ***
2023-04-19T20:08:38.9002894Z deploy-card: true
2023-04-19T20:08:38.9003132Z title: Notification Tests Complete
2023-04-19T20:08:38.9003365Z color: info
2023-04-19T20:08:38.9003571Z timezone: America/New_York
2023-04-19T20:08:38.9003795Z ##[endgroup]
2023-04-19T20:08:40.9529290Z ##[group]Run actions/upload-artifact@v3
2023-04-19T20:08:40.9529566Z with:
2023-04-19T20:08:40.9529825Z name: typescript-docs-artifact
2023-04-19T20:08:40.9530109Z path: docs/publish
2023-04-19T20:08:40.9530355Z retention-days: 1
2023-04-19T20:08:40.9530601Z if-no-files-found: warn
2023-04-19T20:08:40.9530851Z ##[endgroup]
2023-04-19T20:08:41.0327278Z With the provided path, there will be 21 files uploaded
2023-04-19T20:08:41.0330807Z Starting artifact upload
2023-04-19T20:08:41.0331598Z For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
2023-04-19T20:08:41.0332277Z Artifact name is valid!
2023-04-19T20:08:41.0840387Z Container for artifact "typescript-docs-artifact" successfully created. Starting upload of file(s)
2023-04-19T20:08:41.8087234Z Total size of all the files uploaded is 73843 bytes
2023-04-19T20:08:41.8088093Z File upload process has finished. Finalizing the artifact upload
2023-04-19T20:08:41.8353841Z Artifact has been finalized. All files have been successfully uploaded!
2023-04-19T20:08:41.8354426Z
2023-04-19T20:08:41.8354841Z The raw size of all the files that were specified for upload is 425738 bytes
2023-04-19T20:08:41.8355417Z The size of all the files that were uploaded is 73843 bytes. This takes into account any gzip compression used to reduce the upload size, time and storage
2023-04-19T20:08:41.8356173Z
2023-04-19T20:08:41.8356931Z Note: The size of downloaded zips can differ significantly from the reported size. For more information see: https://github.com/actions/upload-artifact#zipped-artifact-downloads
2023-04-19T20:08:41.8357346Z
2023-04-19T20:08:41.8357643Z Artifact typescript-docs-artifact has been successfully uploaded!
2023-04-19T20:08:41.8453728Z Post job cleanup.
2023-04-19T20:08:41.9462709Z [command]/usr/bin/git version
2023-04-19T20:08:41.9514135Z git version 2.40.0
2023-04-19T20:08:41.9575190Z Temporarily overriding HOME='/home/runner/work/_temp/44317737-fd4b-4033-97db-6511160046be' before making global git config changes
2023-04-19T20:08:41.9580282Z Adding repository directory to the temporary git global config as a safe directory
2023-04-19T20:08:41.9589593Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/teams-incoming-webhook-action/teams-incoming-webhook-action
2023-04-19T20:08:41.9637191Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2023-04-19T20:08:41.9678263Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2023-04-19T20:08:41.9928506Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2023-04-19T20:08:41.9946966Z http.https://github.com/.extraheader
2023-04-19T20:08:41.9963742Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2023-04-19T20:08:42.0005887Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2023-04-19T20:08:42.0429851Z Cleaning up orphan processes
Ok you want the debug logs. I've taken the action out of the composite action for testing, here are the results:
##.github/workflows/build.yml
- name: Send message
uses: mikesprague/teams-incoming-webhook-action@v1.10.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
webhook-url: ${{ secrets.MSTEAMS_WEBHOOK }}
color: 'info'
title: "Build Started"
deploy-card: true
with "wrong credentials":
##[debug]Evaluating condition for step: 'Send message'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Send message
##[debug]Loading inputs
##[debug]Evaluating: secrets.GITHUB_TOKEN
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GITHUB_TOKEN'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating: secrets.MSTEAMS_WEBHOOK
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'MSTEAMS_WEBHOOK'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run mikesprague/teams-incoming-webhook-action@v1.10.3
TypeError: Cannot read properties of null (reading 'login')
at populateCard (file:///D:/a/_actions/mikesprague/teams-incoming-webhook-action/v1.10.3/webpack:/teams-incoming-webhook-action/src/lib/cards/deploy.ts:39:1)
Error: Cannot read properties of null (reading 'login')
at file:///D:/a/_actions/mikesprague/teams-incoming-webhook-action/v1.10.3/webpack:/teams-incoming-webhook-action/src/index.ts:97:1
at Generator.next (<anonymous>)
at fulfilled (file:///D:/a/_actions/mikesprague/teams-incoming-webhook-action/v1.10.3/webpack:/teams-incoming-webhook-action/src/index.ts:28:1)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Send message
With the "right" credentials workflow runs fine
In this case, I'll push a change out that may (or may not) help, but I am leaning towards this being a configuration issue vs an actual bug.
The commit author on a GitHub repo should always relate back to a GitHub user (unless the user has been removed from GitHub).
I genuinely still cannot wrap my head around how an email address associated with a commit would relate to a bitbucket user and not a GitHub user but end up in a GitHub repo as a current (vs historical) commit.
In any case, I'll post here again when I push the change out (later today) and if you're still interested you can test the next version then and see if it resolves the original issue for you. I'll wait to close this until I push that change later today.
Here is an issue of a similar action with the same problem, https://github.com/jdcargile/ms-teams-notification/issues/4 A lot of people had the error. I guess it's just something you're no used to but some orgs, like consulting firms has to use multiple git hosting plataforms, and changing the git email on every commit to a different one is just not feasible. I'll wait to test!
That gives a little more context. And I fully understand having to use multiple Git providers
If it were me, I'd either use the same email address so that one email address in my Git configuration maps to the different provider user accounts or I would configure Git to use the appropriate credentials depending on which repo I was working in.
Like you said, not everyone takes the time to configure things properly when working with multiple providers etc. I'll let you know when I release the change, probably within a couple hours.
Yeah but some client orgs ask use to use their provided email/accounts for everything, but they don't really care for the email used for commits, and some companies use microsservices meaning I could have something like 50 projects cloned for a given client. It's a mess but we try to live with it
@ArthurNRL In theory, this may work for you now with your original setup.
Works well!
Thanks for confirming!
Thanks for the effort!
Getting an error while using deploy-card: true