hestonhoffman / changed-lines Goto Github PK
View Code? Open in Web Editor NEWThis GitHub action returns the file names and modified lines of each file in a pull request.
License: MIT License
This GitHub action returns the file names and modified lines of each file in a pull request.
License: MIT License
Hi,
I looked into your action and it seems to deliver pretty much that what I need in our pipeline. I added it and somehow it's delivering weird results.
Action
- name: Get Changed Files
uses: hestonhoffman/changed-lines@v1
id: changed-files
- name: Print Changed Files and Lines
continue-on-error: true
run: echo ${{ steps.changed-files.outputs.changed_lines }}
Result
{.github/workflows/laravel.yml: [4, 8, 9, 10, 26, 40, 41, 47, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 147, 147, 57, 58, 67, 67, 7, 2472, 15639, 15640, 15641, 15642, 15643, 15644, 15645, 15646, 15647, 15648, 15649, 15650, 15651, 15652, 15653, 15654, 15655, 15656, 15657, 15658, 15659, 15660, 15661, 15662, 15663, 15664, 15665, 15666, 15667, 15668, 15669, 15670, 15671, 15672, 15673, 15674, 15675, 15676, 15677, 15678, 15679, 15680, 15681, 15682, 15683, 15684, 15685, 15686, 15687, 15688, 15689, 15690, 15691, 15692, 15693, 15694, 17256, 17256, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]}
This file doesn't even have > 15k lines. ๐
Hey, first thanks for this action script. I'm trying to use this and having trouble as shown below.
Run hestonhoffman/changed-lines@v1
/usr/bin/docker run --name c7ad54b7e304e4983a4805b7c3a50eb8e15057_7dbce2 --label c7ad54 --workdir /github/workspace --rm -e "INPUT_TOKEN" -e "INPUT_BRANCH" -e "INPUT_REPO" -e "INPUT_PR" -e "INPUT_DELIMITER" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/document/document":"/github/workspace" c7ad54:b7e304e4983a4805b7c3a50eb8e15057
Traceback (most recent call last):
File "/app/main.py", line 88, in
added_line_data = parse_patch_data(data)
File "/app/main.py", line 32, in parse_patch_data
if entry['additions'] != 0:
TypeError: string indices must be integers
I tried using v1.1, but that appears to be invalid path. Do you have any recommendation on correct usage of this action script.
I used the exact example below:
on: [ pull_request ]
jobs:
find_changed_lines:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Find changed lines
id: changed_lines
uses: hestonhoffman/changed_lines@v1
- name: Print changed lines
run: echo ${{ steps.changed_lines.outputs.changed_lines }}
Also, I think path must be changed-lines@v1 and not _. Please let me know how to correctly use this action script.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.