Comments (8)
@damirstuhec as documented on: issues: triggers will always run on the default branch as issues don't really have a ref they are associated with.
from toolkit.
Not sure I completely understand the ask, but in general github.context.ref
should have branch info if its available I believe.
I guess I'm not really sure what you mean by "the feature branch from which the comment originated though" - comments aren't really inherently tied to branches - I may be missing something though.
from toolkit.
I'd like access to the branch name generally in the workflow too. I'm porting some things from Travis and I currently upload test results and logs to S3 (to power a web-based dashboard) in a folder {branch_name}/{hash}
but using github.ref
results in them going in a folder called /refs/heads/{branch_name}
which is weird (alternatively, a function that can be used to strip it off would work too).
from toolkit.
Yeah, a convenience function there seems like it could be nice. For now, you can probably do something like:
var branchName = github.context.ref;
if (branchName.indexOf('/refs/heads/') > -1) {
branchName = branchName.slice('/refs/heads/'.length);
}
from toolkit.
@damccorm in my case I'm just trying to use it in the workflow file rather than an action - I don't think I can put arbitrary JS in there?
- name: Upload logs to Amazon S3
run: dpl --provider=s3 --local-dir=".test_results" --upload-dir="${{ github.ref }}/${{ github.sha }}"
from toolkit.
var branchName = github.context.ref; if (branchName.indexOf('/refs/heads/') > -1) { branchName = branchName.slice('/refs/heads/'.length); }
I tried that but the branchName
is always master
, even when the issue_comment
is posted on another branch (PR).
Basically, my use case is a workflow that runs when a specific issue_comment
is posted on a feature branch (PR) which will then trigger a CircleCI job for that branch through their API. Unfortunately, CircleCI only supports triggering the build by a branch name.
from toolkit.
@damirstuhec I don't know if it'll be populated for comments, but there's a head_ref
and base_ref
listed here. It says they're only populated for PR events, but I'm not sure exactly what that means.
from toolkit.
Closing this out since @chrispat answered ^^ and not so much a toolkit issue. Thanks!
from toolkit.
Related Issues (20)
- Decompress based on `content-encoding` in `downloadTool`
- Links created for annotations are (sometimes) broken
- Multiline annotations are not correctly displayed.
- Call another github action like an async function call HOT 2
- `@actions/core` can't be imported in Node 20 HOT 3
- Error logging is lossy
- Question: Why are cache entries uploaded in chunks of 32MB?
- Allow customizing the `GITHUB_SERVER_URL` for GHE instances
- licenseosi HOT 3
- Please remove misleading hope-giving line from main README.md
- Artifact upload speeds are artificially bottle necked to 8 MB chunks HOT 5
- Introduce the ability to interrupt exec() using signal (PR: #1469)
- Allow caching without compression
- Issue for bug
- AƧık
- Multiline Problem Matcher HOT 3
- Support the latest Octokit in `@actions/github` HOT 1
- Would github write a official ssh deploy actions,third party isn't good enough HOT 2
- Core Summary should be more flexible HOT 4
- Calling glob() on a directory of 200k files produces a RangeError: Maximum call stack size exceeded
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toolkit.