René's URL Explorer Experiment


Title: Can't seem to trigger a job based on text in the opening comment · Issue #496 · actions/github-script · GitHub

Open Graph Title: Can't seem to trigger a job based on text in the opening comment · Issue #496 · actions/github-script

X Title: Can't seem to trigger a job based on text in the opening comment · Issue #496 · actions/github-script

Description: @joshmgross ... Hello! Could you help me again with a thorny conditional check for running a job? Earlier, we were working with conditionals for issue labels. Now, I need to run a job based on opening issue body content. Our situation fo...

Open Graph Description: @joshmgross ... Hello! Could you help me again with a thorny conditional check for running a job? Earlier, we were working with conditionals for issue labels. Now, I need to run a job based on open...

X Description: @joshmgross ... Hello! Could you help me again with a thorny conditional check for running a job? Earlier, we were working with conditionals for issue labels. Now, I need to run a job based on open...

Opengraph URL: https://github.com/actions/github-script/issues/496

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can't seem to trigger a job based on text in the opening comment","articleBody":"@joshmgross ... Hello! Could you help me again with a thorny conditional check for running a job? Earlier, we were working with [conditionals for issue labels](https://github.com/actions/github-script/issues/441). Now, I need to run a job based on opening issue body content.\r\n\r\nOur situation for Microsoft ASP.NET Core docs (the official doc set) is that we're having some instability on getting a tool called \"Repoman\" to run and apply labels correctly to newly opened issues. The maintainer of Repoman thinks that there has been some changes in hosting that are interfering with that tool running. When Repoman works, it applies some opening labels, and then my GH workflow sees one of the labels (`blazor/subsvc`) and runs a job. Since Repoman is having trouble getting labels affixed to issues when they're opened, I'm looking for a way for my workflow to run directly and not use Repoman's applied labels.\r\n\r\nWe have some stable body content (a URL in the opening issue comment) that I can search for.\r\n\r\nHere's an example issue: https://github.com/dotnet/AspNetCore.Docs/issues/33931\r\n\r\nYou see there that we have the article link in the body of the opening comment. For example, any Blazor issue that's opened will have a link like this ...\r\n\r\n\u003e https://learn.microsoft.com/en-us/aspnet/core/blazor/...?view=aspnetcore-8.0\r\n\r\n... in the body of the opening comment, so I think if I can just compose an `if:` to find the text \"`aspnet/core/blazor`\" that I would be able to get my jobs to run.\r\n\r\nTherefore, I'm trying `if: contains(github.event.comment.body, 'aspnet/core/blazor')`. Below, I'm showing the line change from looking at a label to a line that checks the body content. However, that change didn't work in testing. It doesn't throw an error, but the conditional fails and the job doesn't run.\r\n\r\nCan you see where I'm going wrong with that `if:` statement? I suspect the check on `github.event.comment.body` is incorrect. I've checked the API docs, but I find it difficult to understand the chaining of properties on the context (`github.event`) for simple use case scenarios like this. I still wish there were many more `if:` examples for common use cases in the docs. Anyway, can you give me a tip on getting this approach to work?\r\n\r\n```diff\r\nname: Issue processing\r\non:\r\n  issues:\r\n    types:\r\n      - opened\r\njobs:\r\n  process-blazor-issue:\r\n-   if: github.event.label.name == 'blazor/subsvc'\r\n+   if: contains(github.event.comment.body, 'aspnet/core/blazor')\r\n    runs-on: ubuntu-latest\r\n    permissions:\r\n      issues: write\r\n    steps:\r\n      - uses: actions/github-script@v6\r\n        with:\r\n          script: |\r\n            await ...\r\n            await ...\r\n            await ...\r\n            await ...\r\n            await ...\r\n            await ...\r\n```","author":{"url":"https://github.com/guardrex","@type":"Person","name":"guardrex"},"datePublished":"2024-10-25T13:26:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/496/github-script/issues/496"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f1435cff-ef4a-26b7-89a4-b4ad2512340e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idED0A:2395E2:1877575:22BBE2D:6A50C76A
html-safe-noncef2e4b98a9404c85fb60a6d0496fce4f73eef64857c5723a0d25e45943398c7ae
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDBBOjIzOTVFMjoxODc3NTc1OjIyQkJFMkQ6NkE1MEM3NkEiLCJ2aXNpdG9yX2lkIjoiMTgxMDE4NzM0MzkwNDE2MzY5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacd03188e3abfe9c033d6f3b84dc46845fbd3070aa284a4b38a9d001060e97a8cc
hovercard-subject-tagissue:2614109876
github-keyboard-shortcutsrepository,issues,actions,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/actions/github-script/496/issue_layout
twitter:imagehttps://opengraph.githubassets.com/cdf03d820576ce6e96f8430295362cc87a97973ac0270d1fc954a4ebba5358d5/actions/github-script/issues/496
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/cdf03d820576ce6e96f8430295362cc87a97973ac0270d1fc954a4ebba5358d5/actions/github-script/issues/496
og:image:alt@joshmgross ... Hello! Could you help me again with a thorny conditional check for running a job? Earlier, we were working with conditionals for issue labels. Now, I need to run a job based on open...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameguardrex
hostnamegithub.com
expected-hostnamegithub.com
None72b13e0e8d0319acdd27a145cfe73f4f06c791713d0ac4690e41fb68ad28cac0
turbo-cache-controlno-preview
go-importgithub.com/actions/github-script git https://github.com/actions/github-script.git
octolytics-dimension-user_id44036562
octolytics-dimension-user_loginactions
octolytics-dimension-repository_id205262760
octolytics-dimension-repository_nwoactions/github-script
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id205262760
octolytics-dimension-repository_network_root_nwoactions/github-script
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release08e79d53fc070870d5b168356afebb1e286a2ffe
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/actions/github-script/issues/496#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Factions%2Fgithub-script%2Fissues%2F496
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Factions%2Fgithub-script%2Fissues%2F496
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=actions%2Fgithub-script
Reloadhttps://github.com/actions/github-script/issues/496
Reloadhttps://github.com/actions/github-script/issues/496
Reloadhttps://github.com/actions/github-script/issues/496
Please reload this pagehttps://github.com/actions/github-script/issues/496
actions https://github.com/actions
github-scripthttps://github.com/actions/github-script
Notifications https://github.com/login?return_to=%2Factions%2Fgithub-script
Fork 572 https://github.com/login?return_to=%2Factions%2Fgithub-script
Star 5k https://github.com/login?return_to=%2Factions%2Fgithub-script
Code https://github.com/actions/github-script
Issues 54 https://github.com/actions/github-script/issues
Pull requests 35 https://github.com/actions/github-script/pulls
Discussions https://github.com/actions/github-script/discussions
Actions https://github.com/actions/github-script/actions
Security and quality 0 https://github.com/actions/github-script/security
Insights https://github.com/actions/github-script/pulse
Code https://github.com/actions/github-script
Issues https://github.com/actions/github-script/issues
Pull requests https://github.com/actions/github-script/pulls
Discussions https://github.com/actions/github-script/discussions
Actions https://github.com/actions/github-script/actions
Security and quality https://github.com/actions/github-script/security
Insights https://github.com/actions/github-script/pulse
Can't seem to trigger a job based on text in the opening commenthttps://github.com/actions/github-script/issues/496#top
https://github.com/guardrex
guardrexhttps://github.com/guardrex
on Oct 25, 2024https://github.com/actions/github-script/issues/496#issue-2614109876
@joshmgrosshttps://github.com/joshmgross
conditionals for issue labelshttps://github.com/actions/github-script/issues/441
dotnet/AspNetCore.Docs#33931https://github.com/dotnet/AspNetCore.Docs/issues/33931
https://learn.microsoft.com/en-us/aspnet/core/blazor/...?view=aspnetcore-8.0https://learn.microsoft.com/en-us/aspnet/core/blazor/...?view=aspnetcore-8.0
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.