GithubHelp home page GithubHelp logo

Comments (3)

lsf37 avatar lsf37 commented on July 18, 2024

That is probably easy to add, and would be useful, yes.

Does this add any new security considerations? So far, a PR must have been raised for the target to be included. Pretty much anyone can do that (apart from blocked users). So the new scope is someone pointing to some branch in a different org they control, but if they are a first-time contributor the tests have to be manually approved first anyway, so I think this is fine.

from ci-actions.

axel-h avatar axel-h commented on July 18, 2024

Looking at https://github.com/seL4/ci-actions/pull/217/files, this could also support hashes. This feature might come for free if this is implemented with the standard git tools. Otherwise is should implement the same behavior, that matching a branch name take preference over matching a commit id.

from ci-actions.

lsf37 avatar lsf37 commented on July 18, 2024

It'll not be entirely free, because constructing the ref for a PR is a bit special, but it could be done relatively easily. The relevant lines in scripts/fetch-extra-prs.sh are these:

REF="refs/pull/${ID}/head"
cd $(repo-util path ${REPO})
echo "Fetching ${REF} from ${REPO_PATH}"
git fetch -q --depth 1 ${URL} ${REF}:${REF}
git checkout -q ${REF}

We'd need to do something similar as in fetch-branch.sh to distinguish pulling a sha from pulling a ref:

elif [ -n "${GITHUB_SHA}" ]
then
REF=${GITHUB_SHA}
FETCH=${REF}
# if nothing better is available, use GITHUB_REF
else
REF=${GITHUB_REF}
FETCH=${REF}:${REF}
fi
echo "Fetching ${REF} from ${REPO_PATH}"
git fetch -q --depth 1 ${URL} ${FETCH}
git checkout -q ${REF}

from ci-actions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.